1) C is Procedural language where as Java Object Oriented language?
2) Java supports pointers?
3) C is a high level language?
Ans: False, C is low level language and Java is high level language
4) Java doesn’t support multi overloading?
5) C and Java both provides automatic garbage collection?
Ans: False , only Java supports automatic garbage collection
1) Both C++ and Java are platform independent?
Ans: Flase , only Java is platform independent.
2) Java supports virtual keyword?
3) What is virtual keyword?
Ans: Virtual keyword is used to modify property, method, event declaration and allowing it to override in derived classes.
4) Java supports both “call by value” and “call by reference”?
Ans: False, Java only supports “call by value”
5) Java is memory safe where as C++ is not?
1) What is need of Serialization? Ans: Serialization concept is used to
2) Is Serializable is marker interface?
Ans: Yes, Serializable is marker interface and it doesn’t have any methods.
3) When NotSerializableException is thrown?
Ans: If you try to serialize an object of a class which implements serializable, but the object includes a reference to an non-
4) What kind of variables don’t save as part of serializable?
Ans: Static & Transient.
5) Will serialization & de-serialization occurs automatically during java runtime system?
6) What is an interface for control over serialization and deserialization?
1) Is Arraylist is Dynamic Array?
2) Is Array is Dyanamic Array?
3) ArrayList is Synchronized, True/False?
4) Iterator can be used in List , set and queue, True/False?
5) Is iteration is fail-fast?
6) what is fail-fast?
Ans: An iteration which throws ConcurrentModificationException is fail-fast Iterator whereas fail-safe iterator never throws
7) Which of the following set maintains Order? TreeSet or HasSet
8) Is set and map both contains both key and values?
Ans: set contains only values , map contains both key and value.
9) Is Collections extend clonable and serializable interfaces?
10)Is Map is part of Collections?
Ans:No , Map is not Collection and collections are not related to Map.
11)How many ways you can iterate over a List?
Ans: By using for each and iterator.
12)Is key object in Map is duplicatable?
Ans: No , key is unique
13)Can we use iterator in HashMap?
Ans: Yes you can use entrySet(), Ex: Iterator iterator = hashMap.entrySet().iterator() .
1)What is Hibernate Framework?
Ans: Hibernate ORM is a framework used to map Java Application Objects to Relational database and vice verse.It is java based ORM framework and will implement Java Persistence interface.
2) What is Java Persistence API?
Ans: Java Persistence is kind of specification to persist, access or manage data between Java Object and database.
3) What are Advantages of Hibernate then JDBC?
Ans: 1) In Hibernate we don’t need SQL language, i.e we don’t write SQL Queries
2) It supports Transaction management(It avoids in consistent data)
3) Creates tables automatically if needed
4) Fast development of application.
4)What are diff ORM’s present in Java?
Ans:Enterprise JavaBeans Entity Beans
Java Data Objects
5) What are the elements in Hibernate?
Ans: Configuration File(hibernate.cfg.xml)
6) Is hibernate supports Transaction management?
7) How many configuration files need to create for each hibernate project?
8) Is Session factory created from Configuration Object?
9) Is Session factory is Thread safe?
Ans: Yes, but it is expensive
10) How many times we need to create Session factory in hibernate project?
Ans: Since it is expensive only one time.
11) Is Session created from Session factory?
12) Is Session is Thread safe?
Ans: No, we need to close this connection once need is done.
13) How many session objects we need to create in hibernate project?
Ans: depends up on number of objects.