Java Language Interview Question and Answers

51. What type of parameter passing does Java support?
  In Java the arguments are always passed by value.
 
Your Name Your Email-ID
Your Answer
52. What is singleton?
 
  • It is one of the design pattern.
  • This falls in the creational pattern of the design pattern.
  • There will be only one instance for that entire JVM.
  • You can achieve this by having the private constructor in the class.
 
Your Name Your Email-ID
Your Answer
53. What is Locale?
  A Locale object represents a specific geographical, political, or cultural region.
 
Your Name Your Email-ID
Your Answer
54. What is the difference between constructors and normal methods?
  Constructors must have the same name as the class and can not return a value. They are only called once while regular methods could be called many times and it can return a value or can be void.
 
Your Name Your Email-ID
Your Answer
55. What is the difference between static and non-static variables?
  A static variable is associated with the class as a whole rather than with specific instances of a class.
Non-static variables take on unique values with each object instance.
 
Your Name Your Email-ID
Your Answer
123456789101112 Page 11 of 12