Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб Java Tutorial - 4 | Edureka в хорошем качестве

Java Tutorial - 4 | Edureka 11 лет назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



Java Tutorial - 4 | Edureka

Take instructor-led Live class on Java Tutorial at : http://www.edureka.co/java-course The following topics were covered in this Java Tutorial: ArrayList, HashMap, HashTable, Exceptions Array List: An ArrayList class is a concrete implementation of List interface. The main significance of ArrayList is its dynamic size allocation. If you do not need dynamic allocation of size then it is better to use arrays instead of ArrayList. It allows duplicate elements. The difference between an ArrayList and an Array is that ArrayList can grow or shrink dynamically where as size of an array is fixed once it is created. ArrayList is present in "util" package. The index of the elements of an ArrayList will start from zero. We use add(Object e) to add the elements to the ArrayList and get(int index) to retrieve the element from the ArrayList by specifying the index. The default capacity of ArrayList is: 10 How to trace elements of ArrayList? We can trace the elements of ArrayList in 4 ways: For-each loop, Iterator, ListIterator, Enumeration. For each loop: Its action is similar to for loop. It traces through all the elements of an array or array list even if we don't specify size of array or "array list". Iterator: It is an interface used to traverse through the elements of collection by using methods like hasNext(), next() and remove(). It can traverse only in forward direction. ListIterator: It is also an interface used to traverse through the elements of collection by using methods like hasNext(), next() and remove(), hasPrevious(), previous(). It can traverse both in forward and reverse direction. Enumeration: It is also an interface used to traverse through the elements of collection by using methods like hasMoreElements(), nextElement(). Its action is similar to iteration but the difference between them is enumeration has no method for removing the element of an array list. HashMap: HashMap is a class which is used to perform operations such as inserting, deleting and locating elements in a Map. You actually create a map in which you pass two kinds of values: one is key and the other is value. Using key you will be putting values in the HashMap and whenever you have to retrieve value we use the key to do it. Map is an interface that maps key to the elements. Maps are unsorted and unordered. It allows one null key and multiple null values. Key acts as indexes. put(key, value)- to insert the values in HashMap. To retrieve element we use Iterator. We use Map.Entry to get the entire set of keys and values and store into the Iterator. By using this entry we get the values and keys. Hash map will give an unordered set of output. HashTable: Its action is similar to HashMap. It also has a key and value. It does not allow null keys and null values. The only difference between HashTable and HashMap is HashTable is synchronized by default where as HashMap is not synchronized. Comprehensive Java 7 Exceptions: Exception is the one that stops the execution of the program unexpectedly. All of the sudden the program stops and returns an error. The process of handling these exceptions is called Exception Handling. Types of Exceptions: Run-time exceptions: These exceptions will occur at run- time i.e when you run your application. Due to this exception your java application will halt. These exceptions are also called as Unchecked Exceptions and handled at run-time i.e by JVM after they have occurred by using try and catch block. Example: ArrayIndexOutOfBoundsException, ArithmeticException, NullPointerException Compile Enforced Exceptions: Before running, the compiler itself tells you that there is a chance of getting an exception or something wrong with your program. These exceptions are also called as Checked Exceptions and handled by java complier before they occur by using throws keyword. Example: IOException, FileNotFoundException. Exception Handling Mechanism: There are 3 ways to handle the run-time exceptions: try block, catch block, finally block. Please write back to us at [email protected] or call us at +91-8880862004 for more information. http://www.edureka.co Visit - http://www.edureka.co/java-course

Comments