Submitted by heartin on Wed, 10/07/2015 - 20:57
Collection Interface is the Root interface in the collection hierarchy.
Important properties Collection interface
-
JDK does not provide any direct implementations of this interface: it provides implementations of more specific subinterfaces like Set and List etc.
Submitted by heartin on Wed, 10/07/2015 - 10:36
This is not a complete list, but few important ones. Please refer to the API doc for the complete list and more details.
Direct subclasses of InputStream
-
AudioInputStream
-
ByteArrayInputStream
Submitted by heartin on Tue, 10/06/2015 - 00:12
You can sort a list of integers based on their natural ordering. You can compare two integers and see which one comes before the other in natural ordering. But how will you compare two objects and sort them in an order. You have two interfaces in Java Comparable and Comparator that will help us compare objects and sort them in an order.
Submitted by heartin on Mon, 10/05/2015 - 22:32
equals()
Method equals check if two objects are equal.
String class and most collection classes overrides equal to check if two objects are meaningfully equal, which means, if two different string objects have the same value.
The equals method for class Object will return true, for any non-null reference values x and y, if x and y refer to the same object.
Submitted by heartin on Mon, 10/05/2015 - 12:45
Generics language feature in Java allow you to write a class using generic types which can then be substituted with any type before actually using it. Generics allow you to write reusable and type safe code.
For example, you can write a generic linked list. The data in the linked list can be one of String, Integer or any other class type. The actual type needed to be decided only before using it and while creating the class you need to create only one reusable generic class.
Pages