Basic Java Interview Question and Answers
77. | Define Cloneable interface and clone() method? |
---|---|
|
|
78. | How many ways can be argument be passed to subroutine and explain them? |
---|---|
An argument can be passed in two ways. They are passing by value and passing by reference.
|
|
79. | What is a ResourceBundle? |
---|---|
ResourceBundle is a Java class which is a more flexible solution for displaying language sensitive user messages. A message can contain several kinds of variables – dates, times, strings, numbers, currencies, and percentages. To format a message in a locale independent manner, you construct a pattern that you apply to a MessageFormat object, and store this pattern in a ResourceBundle. When a program needs a locale specific resource, such as String. | |
80. | What do you know about Dynamic Initialization? |
---|---|
Java allows variables to be initialized dynamically, using any expression valid at the time the variable is declared. Class A { public static void main( string args[]) { double a = 6.0, b= 8.0; // here c is dynamically initialized double c =Math .sqrt( a*a + b*b); System.out.println( 'The result is ' + c); } } Java does not support multiple inheritance, but it simulates this by the use of interfaces. Variables declared inside an interface declaration are implicitly final and static. One interface can inherit another by use of the keyword extends. |
|