Java Interview Questions - Page 12

Question: What is Serialization and deserialization? Answer: Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.

Ads

Tutorials   
Hibernate Interview Questions - What is Hibernate Framework? Hibernate Interview Questions JSF Basic Interview Questions Important Interview Questions in Core Java Core java Interview Questions XML Interviews Question page8,xml Interviews Guide,xml Interviews XML Interviews Question page7,xml Interviews Guide,xml Interviews XML Interviews Question page6,xml Interviews Guide,xml Interviews XML Interviews Question page5,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page30,xml Interviews Guide,xml Interviews XML Interviews Question page29,xml Interviews Guide,xml Interviews XML Interviews Question page28,xml Interviews Guide,xml Interviews XML Interviews Question page27,xml Interviews Guide,xml Interviews XML Interviews Question page26,xml Interviews Guide,xml Interviews XML Interviews Question page25,xml Interviews Guide,xml Interviews XML Interviews Question page24,xml Interviews Guide,xml Interviews XML Interviews Question page23,xml Interviews Guide,xml Interviews XML Interviews Question page22,xml Interviews Guide,xml Interviews XML Interviews Question page21,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page18,xml Interviews Guide,xml Interviews XML Interviews Question page17,xml Interviews Guide,xml Interviews XML Interviews Question page16,xml Interviews Guide,xml Interviews XML Interviews Question page15,xml Interviews Guide,xml Interviews XML Interviews Question page14,xml Interviews Guide,xml Interviews XML Interviews Question page13,xml Interviews Guide,xml Interviews XML Interviews Question page11,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews SQL PL/SQL Terms Deadlock JSF Interview Questions Tomahawk inputCalendar tag Java Questions & Java FAQ J2EE Interviews Question page9,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page8,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page7,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page6,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page5,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page4,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page3,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page20,J2EE Interviews Guide,J2EE Interviews J2EE interview questions page2,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page19,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page18,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page17,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page16,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page15,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page14,J2EE Interviews Guide,J2EE Interviews
Ads

Java Interview Questions - Page 12

     

Question: What is Serialization and deserialization? 
Answer:
Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.

Question: what is tunnelling?
Answer:
Tunnelling is a route to somewhere. For example, RMI tunnelling is a way to make RMI application get through firewall. In CS world, tunnelling means a way to transfer data.

Question: Does the code in finally block get executed if there is an exception and a return statement in a catch block?
Answer:
  If an exception occurs and there is a return statement in catch block, the finally block is still executed. The finally block will not be executed when the System.exit(1) statement is executed earlier or the system shut down earlier or the memory is used up earlier before the thread goes to finally block.

Question: How you restrict a user to cut and paste from the html page?
Answer:
Using javaScript to lock keyboard keys. It is one of solutions.

Question:  Is Java a super set of JavaScript?
Answer:
No. They are completely different. Some syntax may be similar.

Question: What is a Container in a GUI?
Answer:
A Container contains and arranges other components (including other containers) through the use of layout managers, which use specific layout policies to determine where components should go as a function of the size of the container.

Question:  How the object oriented approach helps us keep complexity of software development under control?
Answer:
 

We can discuss such issue from the following aspects:

o Objects allow procedures to be encapsulated with their data to reduce potential interference.

o Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places.

o The well-defined separations of interface and implementation allows constraints to be imposed on inheriting classes while still allowing the flexibility of overriding and overloading.

Question: What is polymorphism?
Answer:
Polymorphism allows methods to be written that needn't be concerned about the specifics of the objects they will be applied to. That is, the method can be specified at a higher level of abstraction and can be counted on to work even on objects of yet unconceived classes.

Question: What is design by contract?
Answer:
The design by contract specifies the obligations of a method to any other methods that may use its services and also theirs to it. For example, the preconditions specify what the method required to be true when the method is called. Hence making sure that preconditions are. Similarly, postconditions specify what must be true when the method is finished, thus the called method has the responsibility of satisfying the post conditions.

In Java, the exception handling facilities support the use of design by contract, especially in the case of checked exceptions. The assert keyword can be used to make such contracts.

Question: What are use cases?
Answer:
A use case describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance. It is part of the analysis of a program. The collection of use cases should, ideally, anticipate all the standard circumstances and many of the extraordinary circumstances possible so that the program will be robust.

Question: What is the difference between interface and abstract class?
Answer:
 

o interface contains methods that must be abstract; abstract class may contain concrete methods.

o interface contains variables that must be static and final; abstract class may contain non-final and final variables.

o members in an interface are public by default, abstract class may contain non-public members.

o interface is used to "implements"; whereas abstract class is used to "extends".

o interface can be used to achieve multiple inheritance; abstract class can be used as a single inheritance.

o interface can "extends" another interface, abstract class can "extends" another class and "implements" multiple interfaces.

o interface is absolutely abstract; abstract class can be invoked if a main() exists.

o interface is more flexible than abstract class because one class can only "extends" one super class, but "implements" multiple interfaces.

o If given a choice, use interface instead of abstract class.

Advertisements

Share on Google+Share on Google+

Java Interview Questions - Page 12

Posted on: January 19, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Java Interview Questions - Page 12   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads