Submit Your Site To The Web's Top 50 Search Engines for Free! Java Tutorial: Learn Java Basics For Free | Learn Java

Thursday, August 11, 2022

Explain Collection Framework Hierarchy in Java 2022 Update.

 Explain Collection Framework Hierarchy in Java 2022 Update. 

All the interfaces and classes for the collection framework are located in java.util package.
The basic interface of the collections framework is the Collection interface which is the root interface of all collections in the API and placed at the top of the collection hierarchy.Collection interface extends the Iterable interface. 
Collection Framework Hierarchy in Java core-java-interview-questions for freshers 



1. List

It handles sequential list of objects. ArrayList, Vector and LinkedList classes implement this interface.

2. Queue

It handles the special group of objects in which elements are removed only from the head. 
Linked List and Priority Queue classes implement this interface.

3. Set

It handles the group of objects which must contain only unique elements. 
This interface is implemented by HashSet and LinkedHashSet classes and extended by 
SortedSet interface which in turn, is implemented by TreeSet.

4. Map

This is the one interface in Collection Framework which is not inherited from Collection interface. 
It handles the group of objects as Key/Value pairs. It is implemented by 
HashMap and HashTable classes and extended by SortedMap interface which in turn is implemented by TreeMap.
Three of above interfaces (List, Queue and Set) inherit from Collection interface.
Although, Map is included in collection framework it does not inherit from Collection interface.





Sunday, July 24, 2022

What are Major Features of java New Update Varsion 2022 ?

         Q: What are the major features of Java ?

             Answer:
             A list of most important features of Java language is given below

1. Simple

Java is easy to learn and its syntax is quite simple, clean and easy to understand. The confusing and ambiguous concepts of C++ are either left out in Java or they have been re-implemented in a cleaner way.
Eg : Pointers and Operator Overloading are not there in java but were an important part of C++.

2. Object Oriented

Java is an object-oriented programming language. Everything in Java is an object. Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behavior. Object-oriented programming (OOPs) is a methodology that simplifies software development and maintenance by providing some rules.

3. Robust

Robust simply means strong. Java is designed to eliminate certain types of programming errors. Java is strongly typed, which allows extensive compile-time error checking. It does not support memory pointers, which eliminates the possibility of overwriting memory and corrupting data. In addition, its automatic memory management (garbage collection) eliminates memory leaks and other problems associated with dynamic memory allocation/de-allocation.

4. Platform Independent

Unlike other programming languages such as C, C++ etc which are compiled into platform specific machines. Java is guaranteed to be write-once, run-anywhere language.On compilation Java program is compiled into bytecode. This bytecode is platform independent and can be run on any machine, plus this bytecode format also provide security. Any machine with Java Runtime Environment can run Java Programs.Java is platform Independent Language

5. Secure

When it comes to security, Java is always the first choice. With java secure features it enable us to develop virus free, temper free system. Java program always runs in Java runtime environment with almost null interaction with system OS, hence it is more secure. Java is designed to be secure in a networked environment too. The Java runtime environment uses a bytecode verification process to ensure that code loaded over the network does not violate Java security constraints.

6. Multi Threading

Java multithreading feature makes it possible to write program that can do many tasks simultaneously. Benefit of multithreading is that it utilizes same memory and other resources to execute multiple threads at the same time, like While typing, grammatical errors are checked along.

7. Architectural Neutral

Compiler generates bytecodes, which have nothing to do with a particular computer architecture, hence a Java program is easy to intrepret on any machine.

Java Inheritance Update 2023 With Program And Example

  Java Inheritance Update 2023 With Program And Example  nheritance is one of the essential concepts in object-orientated programming  (OOP)...