Java FAQ_ Set1
Java FAQ_ Set1
Part1:
1. What is the main method and explain it's signature?
2. What is the difference between JDK, JRE, and JVM?
3. What is the difference between checked and unchecked exceptions?
4. What is the difference between method overloading and method overriding?
5. What is the difference between == and equals() method?
6. What is the difference between ArrayList and LinkedList?
7. What is the difference between this and super keywords ?
8. What are the main features of Java 8 ?
9. What is the difference between Deep copy and Shallow copy ?
10. How does hashmap work internally ?
Part2:
1. Write a java program to print the sum of digits in a given number?
2. Write a java program to print the reverse of a given String?
3. Write a java program to print the largest digit in a given number?
4. Write a java program to print occurrences of a letter in a String ?
5. Write a java program to convert a list to set ?
6. Write a java program to demonstrate throws keyword ?
7. Write a java program to demonstrate yield() method ?
8. Write a java program to print factorial using recursion ?
9. Write a java program to convert the following list into map ?
Given list:
ArrayList of student objects (id,name,percentage,city)
Required map:
HashMap of student objects in which key is id and value is percentage
10. Write a java program to print the sum of salaries of all
employees(id,name,salary,city) who belong to Hyd city using stream api?