0% found this document useful (0 votes)
3 views7 pages

Java Features: OOP, Collections, and More

The document discusses various Java concepts like constructors, interfaces, abstract classes, and collections. It provides the following key points: 1) A constructor gets invoked when a new object is created and has the same name as the class. It can be overloaded and if a parameterized constructor is defined, a non-parameterized one must also be defined. 2) An interface is a template that only contains method declarations without implementations and allows achieving multiple inheritance in Java. 3) An abstract class can contain both abstract and non-abstract methods and is created using the "abstract" keyword. 4) Common Java collection classes and interfaces include ArrayList, LinkedList, HashSet, TreeSet, HashMap,

Uploaded by

Bhawna Pathak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Java Features: OOP, Collections, and More

The document discusses various Java concepts like constructors, interfaces, abstract classes, and collections. It provides the following key points: 1) A constructor gets invoked when a new object is created and has the same name as the class. It can be overloaded and if a parameterized constructor is defined, a non-parameterized one must also be defined. 2) An interface is a template that only contains method declarations without implementations and allows achieving multiple inheritance in Java. 3) An abstract class can contain both abstract and non-abstract methods and is created using the "abstract" keyword. 4) Common Java collection classes and interfaces include ArrayList, LinkedList, HashSet, TreeSet, HashMap,

Uploaded by

Bhawna Pathak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd

Q #5) What do you mean by What is meant by

What are the features in JAVA? Constructor? Interface?


Ans: Features of Java:

Ans: Multiple inheritance 
cannot be achieved in 
Ans: The points given below java. To overcome this 
explain what a Constructor is problem Interface concept 
in detail: is introduced.

Oops concepts

When a new object is created  An interface is a template 
in a program a constructor  which has only method 
gets invoked corresponding to declarations and not the 
Object-oriented the class. method implementation.
The constructor is a method 
which has the same name as 
Inheritance class name.
If a user doesn’t create a 
constructor implicitly a default 
Encapsulation constructor will be created.
The constructor can be 
Polymorphism overloaded.

If the user created a 
constructor with a parameter 
then he should create another 
constructor explicitly without a 
Abstraction parameter.
Platform independent: A single 
program works on different 
platforms without any 
modification.
High Performance: JIT (Just In 
Time compiler) enables high 
performance in Java. JIT converts 
the bytecode into machine 
language and then JVM starts the 
execution.

Multi-threaded: A flow of 
execution is known as a Thread. 
JVM creates a thread which is 
called main thread. The user can 
create multiple threads by 
extending the thread class or by 
implementing Runnable interface.
What is
meant
by
Ordered
Q #25) What are all and
the Classes and Sorted
Q #16) What is Interfaces that are in Ans: Difference between
meant by Abstract available in the collectio HashSet and TreeSet can be
class? collections? ns? seen below:

Ans: We can create 
the Abstract class by 
using “Abstract” 
keyword before the  HashSet TreeSet
class name. An 
abstract class can  Ans: Given below are
have both “Abstract”  the Classes and
methods and “Non- Interfaces that are
abstract” methods that available in
are a concrete class. Collections: Ans:
Inserted elements are in random  Maintain
order s the 
elements 
in the 
sorted 
order

Can able to store null objects Couldn’t 
store null 
objects
Ordered
Interfaces: :
Performance is fast Perform
ance is 
slow
It means 
the 
values 
that are 
stored in 

collectio
n is 
based 
on the 
values 
that are 
added to 
the 
collectio
n. So we 
can 
iterate 
the 
values 
from the 
collectio
n in a 
specific 
Collection order.

List

Set Sorted:

Map
Sorting 
mechani
sm can 
be 
applied 
internally 
or 
externall
y so that 
the 
group of 
objects 
sorted in 

particula

collectio
n is 
based 
on 
propertie
s of the 
Sorted Set objects.

Sorted Map
Queue

Classes:

Lists:

Array List
Vector

Linked List

Sets:

Hash set
Linked Hash Set

Tree Set

Maps:

Hash Map

Hash Table

Tree Map

Linked Hashed Map

Queue:

Priority Queue

You might also like