Java Test

1. What is Java? Can you explain features of Java?
2. What is the difference between JVM, JRE, and JDK?
3. What is the difference between interpreter and compiler?
4. What is .class file?
5. What are primitive and non-primitive data types in Java?
6. What is the difference between = and ==?
7. What is the difference between pre-increment and post increment operator in
java?
8. What is difference between object oriented programming language and object
based programming language?
9. What is type casting?
10. What is the difference between while and do..while loops?
11. What is an array? 
12. How to check length of an array?
13. What are the different ways of defining an array variable?
14. How to store multiple data type values in an array?
15. How to read array elements?
16. What are the types of arrays?
17. What is the difference between for loop and for..each loop?
18. What is the output of following code?
public class Example {  
public static void main(String[] args) {  
    for(int i=1;i<=7;i++){  
        if(i==5){  
            break;  
        }  
      System.out.println(i);  
    }  
}  
} 
19. What is the output of following code?
public class Example {  
public static void main(String[] args) 
  {  
    for(int i=1;i<=7;i++){  
        if(i==5){  
            continue;  
        }  
        System.out.println(i);  
    }  
}  
} 
20.  Explain String methods in Java?
21. How to concat two strings in Java?
22. How to compare two strings in Java?
23. How to find length of a string?
24. How to print current date and time in Java?
25. What is class and object?
26. What is java method?
27. What is instantiation in java?
28. What is call by value and call by reference?
29. What is constructor in java?
30. What is use of constructors?
31. What are the types of constructors available in java?
32. What is method overloading?
33. Can we overload main method?
34. Can we overload constructor?
35. What id use of this keyword?
36. What is the use of static keyword in java?
37. What is Inheritance in java? What are the types of inheritance?
38. What is method overriding? 
39. What is use of super keyword?
40.  How to achieve multiple inheritance in java?
41. What is interface?
42. What is the default access modifier of interface variables and methods?
43. What is the usage of final variable at variable, method level and class level?
44. What is abstract method?
45.  What is java package?
46. How to import external package?
47. What are the access modifiers in java?
48. What is the default access modifier in java?
49. What is exception? What are the types of exceptions in java?
50. What are the different ways of handling exceptions?
51. What is use of finally block in exception handling?
52. Explain final and finally keywords in java?
53. What is difference between array and arraylist in java?
54. How to declare arraylist in java?
55. How to read elements from arraylist?
56. How to check number of elements presents in array list?
57. How to remove all the elements from array list?
58. How to insert elements to arraylist?
59. What is hashmap?
60. What is keyset in hashmap?
61. What is JDBC? Explain how to connect to database using JDBC program?