coderz.py

Keep Coding Keep Cheering!

Queue Interface in Java

The Queue interface extends the Collection interface and is present in java.util package is used to hold the elements about to be processed in FIFO (First In First Out) order. It is an ordered list of objects that can only be used to insert elements at the end of the list and delete elements from […]

September 16, 2022 | Java | No comments

SortedMap Interface in Java

SortedMap is a collection framework interface. It guarantees that the entries are kept in ascending key order. This interface is an extension of the Map interface. TreeMap is the class that implements this interface. Type Parameters: K – the type of keys maintained by this map V – the type of mapped values SortedMap’s parent interface is […]

September 15, 2022 | Java | No comments

IdentityHashMap class in Java

The HashMap class is similar to the IdentityHashMap class. The IdentityHashMap implements the Map interface using Hashtable, and when comparing keys, it uses reference-equality rather than object-equality (and values). This class is not intended to be a general-purpose Map implementation. This class is used when the user wants to compare objects by reference. It is […]

September 14, 2022 | Java | 1 comment

EnumSet in Java

What is EnumSet in Java? The EnumSet is a specialized implementation of the Set interface designed for use with enumeration types. It derives from the AbstractSet class and implements the Set interface. Enum sets are internally represented as bit vectors. This is a very compact and efficient representation. This class’s space and time performance should […]

September 13, 2022 | Java | 1 comment

AbstractSet in Java

AbstractSet is a Java Collection Framework class that implements the Collection interface and extends the AbstractCollection class. It implements the Set interface in its most basic form. This class does not override any of the AbstractCollection class’s implementations, but instead adds equals() and hashCode() methods. Class Hierarchy: Syntax: Where E is the type of elements […]

September 12, 2022 | Java | 1 comment

CopyOnWriteArrayList class

The CopyOnWriteArrayList class, which implements the List interface, is introduced in JDK 1.5. It is an enhanced version of ArrayList in which all changes (add, set, remove, and so on) are implemented by making a new copy. It is included in the java.util.concurrent package. Furthermore, it is a data structure that was created for use […]

September 10, 2022 | Java | No comments

AbstractSequential List in Java

The Java Collection Framework includes the AbstractSequential List class, which implements the Collection interface, and the AbstractCollection class. It is used to implement an unmodifiable list, for which one needs to only extend this AbstractList Class and implement only the get() and the size() methods. AbstractSequential List Method: Method Description add(int index, E element) Inserts […]

September 9, 2022 | Java | No comments

Abstract List in Java

This class provides a skeletal implementation of the List interface in order to reduce the effort required to implement this interface in combination with a “random access” data store (such as an array). Abstract List should be used instead of this class for sequential access data (such as a linked list). Declaration:  Methods of Abstract […]

September 9, 2022 | Java | No comments

File class in Java

The File class represents a file or directory path name in Java. Because file and directory names differ between platforms, naming them with a simple string is insufficient. The File class is used to create files and directories, search for files, delete files, and so on. Fields of File Class Modifier Type Field Description static String pathSeparator It is a path-separator character that is system-dependent and is represented as a string for convenience. static char pathSeparatorChar It is a path-separator character that is system-dependent. static […]

September 7, 2022 | Java | No comments

Inner class in Java

In Java, an inner class is a class that is declared within another class or interface. To summarize, the same logically related classes as Java is purely object-oriented, bringing it closer to the real world.It also has access to all the outer class’s members, including private data members and methods. Syntax: Why do we use […]

September 6, 2022 | Java | No comments

Advertisement