Question Bank Java
Question Bank Java
Q1. What are the features of Java? Difference between JDK, JRE, and JVM.
Q2. What is bytecode? What is a variable? What are the different types of variables?
Q3. What are the difference between static variable and instance variable?
Q4. What are primitive datatypes in java? Define Array? How to declare an array?
Q5. . List out the operator in Java. what is object and Class?
Q6. Define constructors? What are the Types of java constructors?
Q7. What is meant by garbage collection? .Define method?
Q8. What is the use of ‘this’ Keyword? What gives java it’s “write once and run anywhere”
nature?
Q9. Why Java is Platform Independent. Why Java is Platform Independent. Why Java is Platform
Independent.
Q10. Why Java is Architecture-Neutral. What is finalize() method?
Q11. Define method overloading? What is meant by an innerclass?
Q12. What are the uses of the keyword ‘final’? What are static methods?
Q13. What is inheritance? What is the use of ‘Super’ Keyword? Give an example
Q14. Difference between method overloading and method overriding in java.
Q15. What is constructor overloading. How to pass object as argument in java?
Q16. Explain various Access Specifiers in java. What are the uses of the keyword ‘final’?
Q17. What are static methods? Define abstract class?
Q18. How can we achieve multiple inheritance in java? What is meant by Nested Class?
Q19. What is a package? Write a note on import statement?
Q20. Define interface? Explain concept of nesting of interface.
Q21. . What is Iterator class ? Give syntax and use of any two methods of Iterator class.
UNIT-II
Q1. Define an exception. What are the types of Exception in Java.
Q2. Difference between Checked and Unchecked Exceptions.
Q3. What are the keywords in Exception. What is use of try block? What is catch block?
Q4. What is use of ‘throw statement’ give an example? (or) state the purpose of the throw
statement.
Q5. Difference between throw and throws. What is finally in Java with example?
Q6. What is the difference between error and exception? How does nested try catch work in
Java?
Q7. What is thread ? How to create Thread. What are the different states of a thread?
Q8. What is difference between starting thread with Run () and start () method?
Q9. Define multithreading? What is the need of Thread Priorities?
Q10. What are three ways in which a thread can enter the waiting state?
Q11. What is synchronized keyword? In what situations you will Use it?
Q12. What is Inter-thread communication? What are Byte Stream in Java?
Q13. What are Character Stream in Java? What is Java Streaming?
Q14. Write note on FileInputStream and FileOutputStream class.
Q15. what is PrintwriterClass. Write about Scanner Class.
Q16. Explain about Thread Life Cycle. Write a java program to create two threads and execute
simultaneously.
Q17. Write a java program to implement join() method in multithreading.
Q18. How to Write and Read a file in java with an example.
Q19. Write any four methods of file class with their use. Write any four methods of File Input
stream class give their syntax.
Q20. Write a java program to copy the content of the file “file1.txt” into new file “file2.txt”.
Q21. Explain byte stream class in detail. Differentiate between Input stream class and Reader
class.
Q22. Explain fileinputstream class to read the content of a file. Write any two methods of file
and file input stream class each.
Q23. Explain Stream Classes? Explain OutputStreamClass. Write program to handle primitive data
types.
UNIT-III
Q1.What is Functional Interface in Java? Give One Example.
Q2.Give the syntax of Lambada Expression with examples.
Q3. What is Method reference in java. How many type of Method reference are there in java.
Give an example of each.
Q4. What is stream API? What is an Intermediate operation in Stream API?
Q5. What does the filter() method do? When do you use it? What is a Terminal operation in
Stream API?
Q6. What are Default Methods and Static methods in the java interface? Give examples of each
one.
Q7. What is the use of Base64 encoding in Java? How to decode a Base64 encoded file in Java?
Q8. Which is the method that helps to retrieve the repeating annotations in Java?
Q9. What is repeatable annotation in Java 8? What object types can be returned from an
annotation method declaration?
Q10.What are new features added in the switch case statement in Java?
Q11. What is the difference between Sealed classes and Anonymous classes in Java?
Q12. What are the blocks and records classes in java? Give an example for each one.
Q13. What is the diamond operator in Java?
UNIT-IV
Q1. What is the difference between Array and Collection in Java?
Q2. What are the various interfaces used in Java Collections Framework?
Q3. Explain the hierarchy of the Collection framework in Java. What are the advantages of the
collection Framework?
Q4. Difference between ArrayList and LinkedList in the java collection framework?
Q5. What is the difference between List and Set in Java. What is a priority queue in Java?
Q6. What is the difference between List, set, and map in java? What are the features of Java
Hashmap?
Q7. Differentiate between HashSet and HashMap. What is the default size of the load factor in
the hashing-based collection?
Q8. What is the difference between Comparable and Comparator in Java?
Q9. Write a program to iterate the list using the lambda expression.
Q10. Write a program in java to get the collection view of the values present in a HashMap.
Q11. What is a Properties Class in Java? Difference between PriorityQueue and TreeSet in Java?
Q12. List down ways to iterate over Map in java?
Q13. What is the advantage of Properties file? What does the hashCode() method do?
UNIT-V
Q1. What is Spring Framework? What is Inversion of control? What is a Spring IOC Container?
Q2. In How many ways we can define the configuration in spring? Explain each.
Q3. What is Dependency injection? What are the different spring modules?
Q4. Difference between Inversion of Control and Dependency Injection?
Q5. What are Spring MVC, Spring AOP, and Spring Core modules?
Q6. What are Spring MVC, Spring AOP, and Spring Core modules?
Q7. What is Bean? What is BeanFactory and how to use it inside spring?
Q8. What are Bean scopes? What is the Spring bean lifecycle?
Q9. Difference Between BeanFactory and ApplicationContext?
Q10. What is the default bean scope in spring? How @Autowire annotation work?
Q11. What are the Types of Autowiring? How to exclude a Bean from Autowiring?
Q12. What is @Bean annotation in spring? What is @Configuration annotation?
Q13. What are the Features of Spring Boot? What are the advantages of using Spring Boot?
Q14. Define the Key Components of Spring Boot. What are the Spring Boot Starter
Dependencies?
Q15. What does the @SpringBootApplication annotation do internally?
Q16. What are the basic Spring Boot Annotations? How Can We Set Up a Spring Boot Application
With Maven?
Q17. What is @RestController annotation in Spring Boot? What is @RequestMapping annotation
in Spring Boot?
Q18. What are RESTful webservices? What are the core components of a HTTP Request?
Q19. What are the advantages of statelessness in RESTful Webservices?
Q20. What are the features of RESTful Web Services ? What is the concept of statelessness in
REST ?