Core Java - Interview Questions and Answers for 'Java5' - 8 question(s) found - Order By Rating Q1. What are the Wrapper classes available for primitive types ? Core Java
Ans. boolean - java.lang.Boolean
byte - java.lang.Byte
char - java.lang.Character
double - java.lang.Double
float - java.lang.Float
int - java.lang.Integer
long - java.lang.Long
short - java.lang.Short
void - java.lang.Void Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   data types   wrapper classes   adapter design pattern   rare Q2. What are concepts introduced with Java 5 ? Core Java
Ans. Generics , Enums , Autoboxing , Annotations and Static Import. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   generics   enum   autoboxing   annotations   static import   rare Try 1 Question(s) Test Q3. When were Enums introduced in Java ?
Ans. Enums were introduced with java 5. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java5   enum Try 1 Question(s) TestAns. Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   autoboxing   wrapper classes Asked in 2 Companies basic   frequent Ans. An enum type is a special data type that enables for a variable to be a set of predefined constants Sample Code for enum Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   enum   basic interview question basic   frequent Try 2 Question(s) TestAns. By static import , we can access the static members of a class directly without prefixing it with the class name. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   static import   static   java keyword   static import Asked in 4 Companies basic   frequent Q7. What is Scanner class used for ? when was it introduced in Java ? Core Java
Ans. Scanner class introduced in Java 1.5 for reading Data Stream from the imput device. Previously we used to write code to read a input using DataInputStream. After reading the stream , we can convert into respective data type using in.next() as String ,in.nextInt() as integer, in.nextDouble() as Double etc Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   scanner   file io   file input   data input stream  file handling basic Q8. Which of the following was not introduced with Java 5 ? a. Generics b. Strings within Switch c. Enums d. Annotations
Ans. Strings within Switch Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5