#92 ArrayList in Java

Поділитися
Вставка
  • Опубліковано 7 лют 2025
  • Check out our courses:
    Java Full Stack and Spring AI - go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    DevOps with AWS: From Basics to Mastery : go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : go.telusko.com...
    Coupon: TELUSKO20 (20% Discount)
    For More Queries WhatsApp or Call on : +919008963671
    Udemy Courses:
    Spring: go.telusko.com...
    Java:- go.telusko.com...
    Java Spring:- go.telusko.com...
    Java For Programmers:- go.telusko.com...
    Python : go.telusko.com...
    Git : go.telusko.com...
    Docker : go.telusko.com...
    website : courses.telusk...
    In this lecture we will learn:
    Collection in Java
    Use of collection interface and classes
    What is the use of Generics?
    ArrayList and its properties
    How ArrayList is different from Arrays?
    Advantages of Collection framework
    #1
    The collection interface belongs to java.util.Collection package. All classes and methods of collection interface belong to this java.util package.
    API means a library or some features that we can use directly, we do not need to define an implementation for it.
    Collections List, Queue, Map and Set simply extend the Collection interface and this collection interface must have its own class implementation.
    we can also convert a collection into an array.
    ArrayList is used like:
    Collection nums=new ArrayList();
    nums.add(6);
    We can add values in a collection by using the add() method.
    -- We do not have indexing for the collection API.
    In the array, we need to specify its type of it. While Collection API works with objects.
    All the data types classes like integer and float extend an object class and thus collection API directly use an object.
    #2
    To define the data types in collection API, we use Generics.
    You can define the type of an object to which data type class it belongs in angular brackets like:
    Collection(Integer) nums= new ArrayList Integer ();
    Here, we use Integer as it is a class, while int is a primitive data type.
    If we do not specify the datatype of a collection object, then it will give a run-time error.
    #3
    ArrayList is a class that implements a list. The list does not have a method called get because it list works with an index in the values.
    It uses a dynamic array to store the duplicate element of different data types.
    The ArrayList class maintains the insertion order and is non-synchronized.
    The elements stored in the ArrayList class can be randomly accessed.
    The size of an ArrayList is increased automatically if the collection grows or shrinks if the objects are removed from the collection.
    If you want to use and fetch values from an ArrayList, then you can use Collection.
    Collection Integer nums= new ArrayList Integer ();
    If you want to work with an index value, you should use List as it supports index values.
    List Integer nums= new ArrayList Integer ();
    #4 Advantages of Collection Framework:
    Consistent API
    Reduces programming efforts
    Increases program speed and quality
    Github repo : github.com/nav...
    Java:- bit.ly/JavaUde...
    Spring:- bit.ly/SpringU...
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com

КОМЕНТАРІ • 14

  • @GodofStories
    @GodofStories Рік тому +14

    Your explanations, and the way you teach has improved a lot since those vids I've seen from 6 years ago. Especially the presentation. Great stuff!

  • @pavanmudhole2065
    @pavanmudhole2065 Рік тому +1

    actually I was watching this video to know about initial capacity and load factor

  • @sohamchakrabortty6989
    @sohamchakrabortty6989 19 днів тому +1

    Hello sir please tell the name of the vscode extension which is help to show the decompiled file for definition of the the built in class , interface, etc.

  • @padmajan7818
    @padmajan7818 3 місяці тому +1

    instead of Collection can we use ArrayList

  • @TALKCODE8
    @TALKCODE8 Місяць тому

    Sir ,Queue has Enqueue and Dequeue which means Front and Rear right!

  • @_ranjit_patil
    @_ranjit_patil Рік тому +1

    Thanks sir 🙏

  • @Gianni.93
    @Gianni.93 Рік тому +1

    hi, I have this error when I write list instead of Collection.
    The List type is not generic; cannot be parameterized with arguments
    How is it possible?

  • @shivarajme
    @shivarajme Місяць тому

    good one!

  • @aphelmusonda5253
    @aphelmusonda5253 9 місяців тому +1

    Thank you so much please!!!

  • @muskaanchaudhary7783
    @muskaanchaudhary7783 7 місяців тому

    I have a doubt how did import java.xml.transform.Source ; come like sir I think you didn’t explain about it

  • @OpenYourMind400
    @OpenYourMind400 2 роки тому +3

    Done

  • @PFARUKKHAN
    @PFARUKKHAN 3 місяці тому

    si me hair oil chepandi sir

  • @maleeshasandakalum6213
    @maleeshasandakalum6213 Рік тому

    ❤❤❤❤