Que 1. What is dot operator ?
Ans:- The dot operator(.) is used to access the
instance varibles and methods of class
objects.it is also used to access classes and
sub-packages from a package.
===================================================================
Que 2. List any five features of Java ?
Ans:- Some features include Object Oriented, platform
Independent, Robust,interpreted,Multi-threaded.
===================================================================
Que 3. Why deletion in LinkList is fast than ArrayList ?
Ans:- Deletion in linked list is fast because it involves only
updating the next pointer in the node before the
deleted node and updating the previous pointer in
the node after the deleted node.
===================================================================
Que 4. How do you decide when to use ArrayList and LinkList ?
Ans:- if you need to frequently add and remove elements
from the middle of the list and only access the list
elements sequentially, then LinkList should be used.
if you need to support random access, without
inserting or removing elements from any place
other than the end, than ArrayList should be used.
===================================================================
Que 5. What are synchronized methods and synchronized statements ?
Ans:- synchronized methods are methods that are used to control
access to an object.A thread only executes a synchronized method
after has acquired the lock of the methods object or class.
Synchronized Statements are similar to synchronized methods.
A synchronized statements can only be executed after a thread has
acquired the lock of the object or class referenced
in the synchronized statement.
===================================================================
Que 6. What is Polymorphism in Java ?
Ans:- Polymorphism is the ability to of an object to take
on many forms.The most common use of polymorphism
in OOP occur when a parent class reference is used
to refer to a child class object.
===================================================================
Que 7. What are native methods? How do you use them ?
Ans:- Native methods are methods whose implementation is provided
in another programming language such as C.The main objective of native
method are to improve th performance of the system.
===================================================================
Que 8. What is HAS-A relationship in Java ?
Ans:- 1. HAS-A Relationship is also knows as composition(or) aggregation.
2. There is no specific keyword to implement HAS-A relationship but mostly
we can use new operator.
3. The main advantage of reusability.
===================================================================
Que 9. What is Encapsulation ?
Ans:- Binding a data and corresponding method in a single
unit is called encapsulation.If any class follows data
hiding and abstraction such type of class is called encapsulated class.
ENCAPSULATION= ABSTRACTION+DATA HIDING
===================================================================
No comments:
Post a Comment