TreeSet is a widespread Java implementation of the SortedSet interface that employs a Tree for storage. Whether an explicit comparator is provided, a set maintains the ordering of the components using their natural ordering. If the Set interface is to be correctly implemented, this must be compatible with equals. TreeSet class Declaration: The following are […]
July 26, 2022 | Java | No comments
An object’s state can be transformed into a byte stream through a process known as serialization. Deserialization is the opposite procedure, in which the actual Java object is recreated in memory using a byte stream. This mechanism is used to persist the object. We use the writeObject() function of the ObjectOutputStream class to serialize the […]
July 16, 2022 | Java | No comments
Strings are Objects in Java that are internally backed by a char array. They are immutable because arrays are immutable (they can’t grow). Every time you make a change to a String, a new String is created. An array of characters functions similarly to a Java string. Consider the following scenario: is the same as: […]
June 11, 2022 | Java | No comments
What is OOPs? Object-Oriented Programming is a methodology or paradigm for designing a program using classes and objects. Many concepts, such as inheritance, data binding, polymorphism, and others, are available in Object-Oriented Programming. It takes a practical approach to solve a problem. As a result, object-oriented programming is a better and easier way to write programs […]
May 11, 2022 | Java | No comments
Everything revolves around the object in Java, which is an object-oriented language. An object represents a class’s runtime entity and is required to call the class’s variables and methods. A Java object is a member of a Java class (also known as an instance). There is an identity, a behavior, and a state for each […]
May 8, 2022 | Java | No comments