Basic Java Interview Question and Answers

41. Explain the use of "Native" keyword?
  Used in method declarations to specify that the method is not implemented in the same Java source file, but rather in another language.
 
Your Name Your Email-ID
Your Answer
42. What must a class do to implement an interface?
  It must provide all of the methods in the interface and identify the interface in its implements clause.
 
Your Name Your Email-ID
Your Answer
43. What is called Serialization?
  Serialization is the process of writing the state of an object to a byte stream. This is more useful when the state of a program has to be saved to a persistent storage area, such as a file. Serialization is also needed to implement Remote Method Invocation (RMI).
 
Your Name Your Email-ID
Your Answer
44. How can we implement polymorphism in Java?
 
  • Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. There are two types of polymorphism.
  • Method polymorphism through overloading
  • Object polymorphism by inheritance/interfaces.
 
Your Name Your Email-ID
Your Answer