This page would help you to learn basics of some popular programming languages such as C, C++ & Java
Don't wanna be here? Send us removal request.
Text
Map Interface in Java With Program Example
The Map interface is part of Collection framework, however, it is not a sub-interface of the collection. It deals with and represents a group of objects in key-value pair. In this, keys and values are objects where keys must be unique and values can be duplicated. Each key-value pair is termed as Entry and a set of such entries is known as Map. It can be defined as an interface that empowers to…
View On WordPress
0 notes
Text
TreeSet Class in Java With Program Example
TreeSet is an implementation class of NavigableSet interface which is a child interface of SortedSet. It is a class in the collection framework that stores and manipulates elements in some sorting order. It represents self-balancing binary tree as its underlying data structure which makes it a good choice for search and retrieving operations. Syntax: Set<T> set = new TreeSet<T>(); It stores…
View On WordPress
0 notes
Text
LinkedHashSet Class in Java With Program Example
LinkedHashet is an implementation class of the Set interface which also extends the HashSet class. It was introduced in Java 1.4 version. It behaves in the same manner as HashSet except that it preserves or maintains the insertion order of elements inserted in the set. In simple words, It is an implementation of the set interface that stores and manipulates an ordered collection of elements. It…
View On WordPress
#collection#collection framework#data structure#HashTable#java#java program#Linked List#LinkedHashSet
0 notes
Text
HashSet Class in Java With Program Example
Set interface doesn’t provide any additional method, as a result, implementation classes use only collection interface methods. HashSet is an implementing class of Set interface and it represents Hash Table as its underlying data structure. It is a collection of unordered unique elements that don’t allow duplicates. It also doesn’t preserve insertion order as it uses hash code to store an…
View On WordPress
#collection#Collection interface#Hash Table#HashSet#HashSet class#java#java program#Set#Set interface
0 notes
Text
NavigableSet Interface in Java With Program Example
NavigableSet is a child interface of SortedSet that provides navigation methods to navigate through a set. It showcases the same behaviour as SortedSet with some additional navigable attributes & behaviour. It provides several methods that are only applicable to the implementation classes of NavigrableSet interface such as lower(), floor(), and ceiling methods to get elements less than or equal,…
View On WordPress
0 notes
Text
SortedSet Interface in Java With Program Example
SortedSet is a child interface of Set Interface. It exhibits similar behaviour to its parent interface like not allowing duplicates and preserving insertion order. As its name suggests, the elements present in sortedSet, are always stored in sorting order. By default, it applies natural sorting to arrange the elements in a specific order. For example, in the case of numbers, the elements are…
View On WordPress
0 notes
Text
Set Interface In Java With Program Example
Set is a child interface of the Collection interface that represents an unordered collection where each element is unique and cannot be repeated. It only consists of methods inherited from its parent interface and doesn’t allow duplicate elements. Further, if someone tries to add a duplicate via add() method, then it would return false, signifying the given element is not able to get added. It is…
View On WordPress
0 notes
Text
LinkedList Class in Java with Program Example
LinkedList is child class of List and Queue interface. It owns the behaviour of Doubly Linked List and represents its underlying data structure . It is ideal to use when insertion or deletion are the frequent operations. In Linked List, elements are not stored in sequential manner,instead, each element in a Linked List is stored as a separate node, pointing to the previous and next elements in…
View On WordPress
0 notes
Text
Stack Class in Java with Program Example
Stack extends Vector class that implements Last in first out (LIFO) data structure, introduced in JDK 1.0. The data structure specifies the last element to be added to the stack, is the first one to be removed. It is a subclass of the Vector class that enables it to inherit all the attributes and methods of its parent class. It is considered as a legacy class as it exist even before the…
View On WordPress
0 notes
Text
Vector Class in Java With Program Example
Vector is a collection class that implements dynamic array data structure to store elements, signifying growable array as its underlying data structure. It accepts duplicate elements and preserves insertion order. It can hold elements of different data types and allows null value. The Vector class was introduced in Java 1.2 version and is part of the original Java API. It is similar to…
View On WordPress
#collection#collection framework#Contructor of Vector#java#java program#Legacy class#List interface#Methods of Vector#Vector class
2 notes
·
View notes
Text
ArrayList Class in Java With Program Example
Arraylist is a child class of AbstractList and implements List interface. It represents dynamic array that can grow or shrink as needed. In case of standard array, one must know the number of elements about to store in advance. In other words, a standard array is fixed in size and its size can’t be changed after its initialisation. To overcome this problem, collection framework provides…
View On WordPress
#arraylist#collection#collection framework#Hierarchy in Collection Framework#java#java program#List interface
2 notes
·
View notes
Text
Difference between Comparable and Comperator in Java in Tabular Form
In Java, there are two interfaces that provides a way to sort and compare objects, namely Comparable and Comparator. Both interfaces play significant roles in sorting and ordering elements, but they differ in when it comes to identify ordering of elements. The classes that implements Comparable interface support default natural sorting, if one needs to implement a customized sorting order then…
View On WordPress
0 notes
Text
List Interface in Java With Program Example
List interface inherits Collection interface that provides behaviour to store a group of individual objects. It represents group of individual objects as single entity where duplicates are permitted and elements are ordered in the same manner in which they are inserted. It resides within java.util packages. It defines listIterator() method which returns ListIterator object which empowers the…
View On WordPress
#collection#collection framework#Hierarchy in Collection Framework#java#java program#List#List interface
0 notes
Text
Java Iterable Interface With Program Examples
Iterable is a generic interface that represents elements which can be iterated. It resides in java.lang package and was introduced in 1.5 version. It contains iterator() method that is mandatory to implement by its implementing classes, otherwise objects of that very classes can’t be used within for-each loop. Syntax interface Iterable<T> {} T represents object type required for…
View On WordPress
0 notes
Text
Collections in Java With Program Examples
A collection can be defined as a group of objects (elements) represented as a single entity. Collections in Java can be viewed as Collection Framework which is the most powerful feature. Collection Framework represents a hierarchy of interfaces and classes that is used to manage, handle and store groups of objects efficiently. It resides within java.util package. It wasn’t initially part of Java…
View On WordPress
#Collection classes#collection framework#Collection interfaces#collections#Collections in Java#Hierarchy in Collection Framework#java
0 notes
Text
Strike thrpugh backup
function getTextDecorationOperation(action){let textArea=document.getElementById(‘strike-through-text-generator-input’);let text=textArea.value;let…
View On WordPress
0 notes
Text
Java Inheritance With Program Example
Java Inheritance With Program Example
Inheritance is an essential feature of object-oriented programming as it enables us to create and manage a hierarchy of classes. With the help of inheritance, a new class can acquire common attributes and behaviour from an existing class, which implies a class can reuse methods or fields of the superclass. Further, it can also have its own additional methods and fields. Inheritance represents the…
View On WordPress
#application of inheritance#inheritance#java#java program#oops#rules of inheritance#types of inheritance
1 note
·
View note