11)What is the ResourceBundle class?
A)The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program’s appearance to the particular locale in which it is being run.
12) Why there are no global variables in Java?
A)Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:
• The global variables breaks the referential transparency
• Global variables creates collisions in namespace.
13)How to convert String to Number in java program?
A)The valueOf() function of Integer class is is used to convert string to Number. Here is the code example:
String numString = “1000″;
int id=Integer.valueOf(numString).intValue();
14)What is the SimpleTimeZone class?
A)The SimpleTimeZone class provides support for a Gregorian calendar.
15)What is the difference between a while statement and a do statement?
A)A while statement (pre test) checks at the beginning of a loop to see whether the next loop iteration should occur. A do while statement (post test) checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the loop body at least once.
16)What is the Locale class?
A)The Locale class is used to tailor a program output to the conventions of a particular geographic, political, or cultural region.
No comments:
Post a Comment