DEPARTMENT OF COMPUTER SCIENCE
CLASS : II B.Sc Computer Science
                              Subject Name: Java Programming
                                     Subject Code : 225C3A
                                              UNIT : 1
PART - A (2 Marks Questions)
   1. What are Java buzzwords? Mention any two.
   2. Define platform independence in Java.
   3. What is the role of the JVM?
   4. Write the structure of a basic Java program.
   5. Explain the purpose of the main method in Java.
   6. What is System.out.println() used for?
   7. Define any two Java primitive data types.
   8. Differentiate between type casting and type conversion.
   9. What is the use of BufferedReader in Java?
   10. Write any two Java operators with examples.
   11. What is the difference between if and switch statements?
   12. Define static variable and static method with examples.
   13. What is the difference between String and StringBuffer?
   14. Who invented Java?
   15. Difference between compilation and interpretation.
PART - B (5 Marks Questions)
   1. Explain the key object-oriented features of Java with examples.
   2. Describe the JVM architecture and its components.
   3. Write a simple Java program and explain its structure.
   4. Explain Java buzzwords: Platform Independence, Portability, and Threads.
   5. Discuss Java data types and how type casting and type conversion work.
   6. Compare System.out.print() and System.out.println() with examples.
   7. Describe the role of the main() method in a Java program.
   8. Write a program to demonstrate Java console input using BufferedReader.
   9. Explain the use of control statements (if, for, while, switch) with examples.
   10. Differentiate between String and StringBuffer classes with examples.
PART - C (10 Marks Questions)
   1. Explain the core Object-Oriented Programming concepts in Java with suitable examples.
   2. Describe JVM architecture in detail. How does it help in platform independence?
   3. Write a Java program using all data types and explain how type conversion and casting are done.
   4. Explain Java program structure and describe the purpose of each component (class, method,
      object).
   5. Demonstrate console input and output in Java using BufferedReader and System.out. Include
      error handling.
   6. Write a program to show the use of control structures (if-else, switch, loops) and explain how
      they work.
   7. Differentiate between String and StringBuffer classes with examples. Mention memory and
      performance aspects.
                                                  UNIT : 2
PART - A (2 Marks Questions)
   1. How are user-defined classes created in Java?
   2. Define a constructor with an example.
   3. What is single inheritance? Give an example.
   4. Explain the purpose of the super keyword.
   5. Differentiate between method overloading and method overriding.
   6. What is an abstract class?
   7. What do you mean by dynamic method dispatch?
   8. What is the purpose of the final keyword?
   9. Define a package and its use.
   10. How do you import a package in Java?
   11. Define an interface. How is it implemented?
   12. What is the use of this keyword?
   13. Distinguish between objects and classes.
   14. Write down the rules for naming classes?
   15. How to create object in java? Give an example.
PART - B (5 Marks Questions)
   1. Explain how to create user-defined classes and objects in Java with a code sample.
   2. Write a Java program to demonstrate the use of constructors and constructor overloading.
   3. Explain the concept of inheritance and its types with diagrams or code.
   4. Discuss the use of this and super keywords in Java.
   5. Differentiate between method overloading and method overriding with examples.
   6. Write a Java program to demonstrate the use of abstract classes.
   7. Explain dynamic method dispatch with a sample program.
   8. What is a package in Java? How is it defined and imported?
   9. Discuss how interfaces are defined, implemented, and extended in Java.
   10. Explain the significance and usage of the final keyword in Java.
PART - C (10 Marks Questions)
   1. Write a Java program to demonstrate the creation and use of user-defined classes and objects.
      Explain each part.
   2. Discuss constructor overloading in detail. Write a Java program using multiple constructors.
   3. Explain the types of inheritance in Java with examples. How is ambiguity resolved?
   4. Write a program demonstrating method overloading and method overriding. Explain runtime
      and compile-time polymorphism.
   5. Describe abstract classes and interfaces. Compare and contrast them with proper examples.
   6. Explain the concept of dynamic method dispatch with a Java program and its execution flow.
   7. What are packages in Java? Write a program using packages and access modifiers. Explain
      access control.
                                                 UNIT : 3
PART - A (2 Marks Questions)
   1. What is an exception?
   2. Write the syntax of a try-catch block.
   3. What is the use of finally block?
   4. Differentiate between throw and throws.
   5. Name two built-in exceptions in Java.
   6. How is a user-defined exception created?
   7. What is the use of finalize() method?
   8. Differentiate between Thread class and Runnable interface.
   9. What is synchronization?
   10. What is interthread communication?
   11. What is a deadlock?
   12. What is compile-time errors?
   13. What are Run-time errors?
   14. Write the purpose of Exception Handling
   15. What is the use of throws keyword?
PART - B (5 Marks Questions)
   1. Explain exception handling in Java using try, catch, finally, throw, and throws.
   2. Write a Java program to demonstrate the creation of a user-defined exception.
   3. What are built-in exceptions? List and explain any five with examples.
   4. Describe garbage collection and the role of finalize() method.
   5. Differentiate between Thread class and Runnable interface with code.
   6. Write a program to create and start multiple threads using the Thread class.
   7. What is synchronization in Java? How are synchronized methods used?
   8. Explain inter-thread communication with an example.
   9. What is a deadlock in multithreading? How can it be prevented?
   10. Discuss the life cycle of a thread in Java.
PART - C (10 Marks Questions)
   1. Explain the complete exception handling mechanism in Java. Include built-in and user-defined
      exceptions.
   2. Write a Java program that uses try-catch-finally, throw, and throws together. Explain each
      construct.
   3. What is multithreading? Compare extending Thread class vs implementing Runnable interface
      with code.
   4. Write a multithreaded Java program that includes synchronization. Explain how it prevents race
      conditions.
   5. Discuss inter-thread communication. Write a Java program using wait(), notify(), and
      notifyAll().
   6. What is deadlock in Java? Explain with an example program and suggest how to avoid it.
   7. Explain garbage collection in Java. What is the purpose of the finalize() method?
                                                  UNIT : 4
PART - A (2 Marks Questions)
   1. Define AWT.
   2. Name any two top-level containers in Swing.
   3. What is the difference between JFrame and JPanel?
   4. Mention any two components used in Swing UI.
   5. What is the use of JTextArea?
   6. Define event in Java event handling.
   7. What is the Event Delegation Model (EDM)?
   8. Differentiate between JCheckBox and JRadioButton.
   9. How is a mouse event handled in Java?
   10. What is the use of JScrollPane.
   11. Define Layout Manager.
   12. What is JButton Control?
   13. What are Swing controls?
   14. What is a container in a GUI?
   15. What is the difference between applications and swing controls?
PART - B (5 Marks Questions)
   1. Draw and explain the AWT class hierarchy.
   2. What is Swing in Java? How does it differ from AWT?
   3. Write a Java Swing program using JFrame and add multiple components.
   4. Explain the use and differences between JPanel, JDialog, and JFrame.
   5. Compare JButton, JToggleButton, JCheckBox, and JRadioButton with examples.
   6. What is the purpose of JScrollPane? Demonstrate its use with a program.
   7. Describe the event delegation model with a diagram.
   8. Explain how mouse and keyboard events are handled in Swing applications.
   9. Describe the different types of event listeners used in Java.
   10. Create a simple GUI using Swing to take user input from a JTextField.
PART - C (10 Marks Questions)
   1. Explain the AWT class hierarchy with a diagram. Write a basic AWT application using AWT
      components.
   2. Describe the hierarchy of Swing components and explain top-level containers with a simple GUI
      application.
   3. Write a Java program using Swing components like JFrame, JButton, JTextField, and JLabel.
      Explain layout management.
   4. Discuss the differences between AWT and Swing. Which one is preferred and why?
   5. What is the Event Delegation Model in Java? Explain with mouse and keyboard event examples.
   6. Write a Java program that handles multiple events (button click, checkbox selection, radio
      button selection) and explain the event listener model.
   7. Explain the use of JList, JComboBox, and JScrollPane with examples. Create a mini form using
      them.
                                                 UNIT : 5
PART - A (2 Marks Questions)
   1. What is an adapter class?
   2. Define inner class with example.
   3. Name any two interfaces in Java Collections Framework.
   4. What is the purpose of Iterator interface?
   5. Differentiate between List and Set.
   6. How is ArrayList different from Vector?
   7. Define enumeration in Java.
   8. What is the use of Comparator?
   9. Write note on enum operator.
   10. Define ArrayList in Java.
   11. What is Vector?
   12. What are the advantages of vectors over arrays?
PART - B (5 Marks Questions)
   1. What are adapter classes? How are they used in event handling?
   2. Explain different types of inner classes in Java with examples.
   3. Describe the Java Collections Framework and its importance.
   4. Explain the use of Iterator and Enumeration with examples.
   5. Differentiate between ArrayList and Vector with example programs.
   6. What are the differences between List, Set, and Map interfaces?
   7. Write a Java program to demonstrate the use of ArrayList.
   8. Explain how Comparator is used for custom sorting in Java.
   9. Discuss how Collections.sort() works and how it uses Comparable.
   10. Write a Java program to demonstrate the use of Collection and List interfaces.
PART - C (10 Marks Questions)
   1. What are adapter classes in Java? How do they simplify event handling? Write a sample
      program.
   2. Explain different types of inner classes in Java with syntax and examples. Discuss their
      advantages.
   3. Describe the Java Collections Framework in detail. What are the key interfaces and their roles?
   4. Compare and contrast ArrayList, Vector, and LinkedList with example code.
   5. Write a Java program that demonstrates the use of Collection, Iterator, List, and ArrayList.
      Explain iteration.
   6. What is the difference between Comparable and Comparator? Write code using both for sorting.
   7. Explain enumeration in Java. How is it used in legacy collections like Vector?