Tricky Mixed Interview Questions 1. What are Wrapper classes in Java? Java has concept of Wrapper classes to allow primitive types to be accessed as objects. Primitive types like boolean, int, double, float etc. have corresponding Wrappers classes – Boolean, Integer, Double, Float etc. Many of these Wrapper classes are in java.lang package. Java 5.0 has launched the concept of Autoboxing and Unboxing in Java for Wrapper classes. E.g. public class WrapperTest{ public static void main(String args[]){ //Converting int into Integer int count=50; Integer i=Integer.valueOf(count); //converting int into Integer Integer j=a; //autoboxing, now compiler will write Integer.valueOf(count) internally System.out.println(count+" "+i+" "+j); } } 2. What is the purpose of native method in Java? The native keyword is used for applying to a method to indicate that the method is implemented in native code using JNI(Java Native Interface). The...
Top 1000+ Interview Question Java JSP Spring Hibernate java collection multithreading java string serialization and desensitization final keyword in java package java design patterns maven git repository cloud computation UNIX shell interview question