Connect with fellow learners in the PlacePrep Discord communityㆍ Join now →
R's PlacePrep

Java Programming 2025

2 sections, 9 questions

Code: 105606
Sem: VI
Marks: 70
Duration: 03 Hours

MCQ Section

1 questions
Q1. Choose the correct option / answer the following (Any seven question only) [2 × 7 = 14]

(a) The Java Virtual Machine (JVM) is responsible for:

  1. Compiling Java code into bytecode
  2. Interpreting bytecode and executing it
  3. Debugging Java applications
  4. Converting Java to C++

(b) Which of the following is used to accept input from the keyboard in Java?

  1. DataInputStream
  2. Scanner
  3. InputReader
  4. FileReader

(c) Which method is used to compare two strings in Java for content equality?

  1. compareTo()
  2. equals()
  3. ==
  4. match()

(d) What is a constructor in Java?

  1. A special method to destroy objects
  2. A method called when an object is created
  3. A variable declaration
  4. None of the above

(e) Which method in Java is always static?

  1. toString()
  2. finalize()
  3. main()
  4. equals()

(f) What is a package in Java?

  1. A group of related classes and interfaces
  2. A single class file
  3. A method container
  4. A block of code

(g) Which class is the superclass of all exceptions?

  1. Throwable
  2. Error
  3. Exception
  4. RuntimeException

(h) Which of the following will cause a compile-time error?

  1. Division by zero
  2. File not found
  3. Array index out of bounds
  4. Missing return statement

(i) Which method is used to draw text in a frame or applet?

  1. print()
  2. write()
  3. drawString()
  4. display()

(j) Which interface provides methods to execute SQL statements?

  1. Connection
  2. Statement
  3. ResultSet
  4. DriverManager

Long Answer Questions

8 questions
Q2. [7 + 7 = 14]

(a) Describe the architecture of the Java Virtual Machine (JVM) and its role in program execution.

(b) Explain different operators and control statements in Java with examples.

Q3. [7 + 7 = 14]

(a) Describe the String class and explain the concept of immutability in strings.

(b) What is a constructor in Java? Explain its types and uses with examples.

Q4. [7 + 7 = 14]

(a) What are packages in Java? Discuss their types and access specifiers.

(b) Explain the use of this and super keywords in Java with examples.

Q5. [7 + 7 = 14]

(a) Discuss the life cycle of a thread in Java and methods used to manage it.

(b) What are a deadlock in threads? How can it be prevented?

Q6. [7 + 7 = 14]

(a) What are exceptions in Java? Explain the types of exceptions with examples.

(b) Describe the steps to create and execute an applet in Java.

Q7. [7 + 7 = 14]

(a) What are Swing components? How do they differ from AWT components?

(b) Explain how graphics and text can be displayed using AWT classes.

Q8. [7 + 7 = 14]

(a) Discuss the concept of event handling and various listener interfaces in AWT.

(b) What is JDBC? Explain its architecture and importance in Java programming.

Q9. [7 + 7 = 14]

(a) Explain the process of storing and retrieving files or images using JDBC.

(b) List and explain different types of JDBC drivers and their uses.


Last updated: 2026-10-31