Saturday, October 19, 2019

Java Interview Questions


Image result for java


Abstract Class:
  • Abstract classes have a default constructor and it is called whenever the concrete subclass is instantiated.
  • Contains Abstract methods as well as Non-Abstract methods.
  • The class which extends the Abstract class shouldn’t require implementing all the methods, only Abstract methods need to be implemented in the concrete sub-class.
  • Abstract Class contains instance variables.
Interface:
  • Doesn’t have any constructor and couldn’t be instantiated.
  • Abstract method alone should be declared.
  • Classes which implement the interface should provide the implementation for all the methods.
  • The interface contains only constants.

Image result for java
  What is mean by Collections in Java?
Ans: Collection is a framework that is designed to store the objects and manipulate the design to store the objects.
Collections are used to perform the following operations:
  • Searching
  • Sorting
  • Manipulation
  • Insertion
  • Deletion
A group of objects is known as collections. All the classes and interfaces for collecting are available in Java utile package.
 What are all the Classes and Interfaces that are available in the collections?
Ans: Given below are the Classes and Interfaces that are available in Collections:
Interfaces:
  • Collection
  • List
  • Set
  • Map
  • Sorted Set
  • 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

No comments:

Post a Comment

Which Python course is best for beginners?

Level Up Your Python Prowess: Newbie Ninjas: Don't fret, little grasshoppers! Courses like "Learn Python 3" on Codecade...