0% found this document useful (0 votes)
3 views7 pages

Java PYQ Important Questions

The document is a question bank for Java Programming for Semester IV, provided by SBTE Bihar, containing both descriptive and multiple-choice questions. It highlights high-priority questions marked in red that have appeared in multiple past papers. The content is organized into units covering various Java topics such as basic syntax, inheritance, exception handling, and input/output management.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Java PYQ Important Questions

The document is a question bank for Java Programming for Semester IV, provided by SBTE Bihar, containing both descriptive and multiple-choice questions. It highlights high-priority questions marked in red that have appeared in multiple past papers. The content is organized into units covering various Java topics such as basic syntax, inheritance, exception handling, and input/output management.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Programming

Previous Year Question Bank


SBTE Bihar · Semester IV

★ Questions marked in RED appeared 2 or more times across papers — HIGH PRIORITY

Papers analysed: 2018503A (Nov 2018) · 1618505 (Nov 2016)

SECTION A — DESCRIPTIVE QUESTIONS


Questions from Group B (4 marks) and Group C (6 marks). Each question has an OR alternative. Attempt any 5 per
group.

Unit 1: Basic Syntactical Constructs in Java


Topics: Java Features, OOP Concepts, JDK/JRE/JVM, Data Types, Operators, Control Statements

Q1. Define garbage collection in Java. [2018503A(Q2)]


★ Q2. State the purpose of the break and continue statements in JAVA. [Repeated:
2018503A(Q2), 1618505(Q7)]

Q3. Discuss the effect of operator precedence on expression evaluation in Java. [2018503A(Q5)]
★ Q4. Define JDK, JRE, and JVM, and discuss their differences. [Repeated: 2018503A(Q5),
2018503A_2(Q2)]

Q5. Explain automatic type promotion in expressions. [2018503A(Q6)]


Q6. Discuss various data types used in Java with proper example. [1618505(Q6)]
Q7. Discuss arithmetic, bitwise and relational operators with proper example. [1618505(Q6)]
★ Q8. Write a program in Java to explain Recursion. [Repeated: 1618505(Q7), 2018503A_2(Q7)]
Q9. Explain the working of break and continue with Java code. [1618505(Q7)]
★ Q10. Discuss JAVA iteration statement / loop statements. [Repeated: 1618505(Q10),
2018503A(Q6)]

Q11. Write a program for matrix multiplication in JAVA. [1618505(Q10)]


★ Q12. Discuss JAVA selection statement with example. [Repeated: 1618505(Q8), 2018503A_2(Q4)]
Q13. Explain Java's platform independence. [2018503A(Q7)]
Q14. Differentiate between JDK and JRE. [2018503A_2(Q2)]
Q15. Discuss the process of initializing and definition of the variable in JAVA. [2018503A_2(Q3)]
Q16. Compare applets with application program. [1618505(Q5)]
Q17. Discuss class interfaces and drivers related to JDBC. [2018503A_2(Q6)]
Q18. Explain how to connect a Java application to a database using JDBC. [2018503A(Q7)]
Unit 2: Derived Syntactical Constructs
Topics: Constructors, 'this' keyword, Arrays, Strings, Visibility Control

Q1. Explain the role of constructors within a Java class. [2018503A(Q3)]


Q2. Present the concept of 'Java buzzwords' with examples. [2018503A(Q3)]
Q3. Discuss the purpose of the 'this' keyword. [2018503A(Q4)]
★ Q4. Provide an explanation of method overloading with an example. [Repeated: 2018503A(Q4),
1618505(Q8)]

Q5. Discuss overloading of method in Java with example. [1618505(Q8)]


Q6. Describe the role of constructors in Java, and differentiate between default and
parameterized constructors. [2018503A(Q11)]
Q7. Write a program to demonstrate the following to compare two strings. [2018503A_2(Q2)]
Q8. Explain the concept of class and how objects are created. [2018503A_2(Q6)]
★ Q9. Define the term static method with example. [Repeated: 1618505(Q3), 2018503A_2(Q3)]
★ Q10. Discuss about managing users and Groups. [Repeated: 1618505(Q3), 2018503A_2(Q11)]
Q11. Write a program to search a number in an array. [1618505(Q4)]

Unit 3: Inheritance, Interface and Package


Topics: Inheritance, Interface, Packages, Polymorphism, Encapsulation, super keyword

Q1. Explain the fundamentals of inheritance and the use of the 'super' keyword. [2018503A(Q8)]
Q2. Explain the concept of encapsulation with examples. [2018503A(Q8)]
Q3. Compare polymorphism and inheritance, giving examples of each. [2018503A(Q9)]
★ Q4. Discuss the inheritance in detail with examples. [Repeated: 1618505(Q11), 2018503A_2(Q4)]
Q5. Explain Java's bytecode and its significance in Java's portability. [2018503A(Q10)]
Q6. Discuss operator types and their usage in Java programming. [2018503A(Q10)]
★ Q7. How to create a package? Explain with example. [Repeated: 1618505(Q2), 2018503A_2(Q9)]
Q8. Explain the finality of the final class. [1618505(Q2)]
Q9. Define the term static method with example. [1618505(Q3)]

Unit 4: Errors, Exception Handling & Multithreading


Topics: Exception Handling, Try-Catch, Built-in Exceptions, Threads, Synchronization

Q1. Discuss the importance of exception handling in Java and give examples. [2018503A(Q9)]
★ Q2. Explain exception handling and its types in detail. [Repeated: 1618505(Q11), 2018503A_2(Q5)]
Q3. Explain the exception handling and its types in detail. [2018503A_2(Q5)]
Q4. Explain Java thread model. Discuss the thread priorities. [1618505(Q9)]
Q5. Describe the multithreading model in Java. Explain synchronization in JAVA. [2018503A(Q11)]
★ Q6. Differentiate between thread and process. [Repeated: 1618505(Q5), 2018503A_2(Q3)]
Q7. Discuss JAVA iteration statement. [2018503A_2(Q5)]
Unit 5: Managing Input/Output/Files in Java
Topics: Streams, Byte/Character Streams, File Class, I/O Exceptions

★ Q1. Write a program to read and write files in Java. [Repeated: 1618505(Q9), 2018503A_2(Q7)]
★ Q2. Discuss garbage collection in JAVA. [Repeated: 1618505(Q10), 2018503A_2(Q10)]
Q3. Write a program to find out whether the given number is palindrome or not. [2018503A_2(Q10)]
Q4. Give the attributes of applet tag. [2018503A_2(Q11)]
SECTION B — MULTIPLE CHOICE QUESTIONS (MCQs)
1 mark each · 20 questions per paper · Questions in RED appeared in multiple papers

★ RED = appeared in 2+ papers (HIGH PRIORITY)

■■ Unit 1 — Basic Java & OOP


MCQ 1. Number of primitive data types in Java [1618505]
(a) 6
(b) 7
(c) 8 ✓
(d) 9

MCQ 2. Who invented Java programming? [1618505]


(a) Guido van Rossum
(b) James Gosling ✓
(c) Dennis Ritchie
(d) Bjarne Stroustrup

MCQ 3. Which of these cannot be used for a variable name in Java? [1618505]
(a) identifier & keyword
(b) identifier
(c) keyword ✓
(d) none of the mentioned

MCQ 4. What is truncation in Java? [1618505]


(a) floating point value assigned to a floating type
(b) floating point value assigned to an integer type ✓
(c) integer value assigned to floating type
(d) integer value assigned to integer type

MCQ 5. Which of these are selection statements in Java? [1618505]


(a) break
(b) continue
(c) for()
(d) if() ✓

MCQ 6. Which keyword is used for the block to be examined for exceptions? [1618505]
(a) check
(b) throw
(c) catch
(d) try ✓

MCQ 7. What is the numeric range of char data type in Java? [1618505]
(a) 0 to 256
(b) -128 to 127
(c) 0 to 65535 ✓
(d) 0 to 32767

MCQ 8. The \u0021 article is referred to as a [1618505]


(a) unicode escape sequence ✓
(b) octal escape
(c) hexadecimal
(d) line feed

MCQ 9. Evaluate: x=3, y=5, z=10 → ++z+y-y+z+x++ [1618505]


(a) 24 ✓
(b) 23
(c) 20
(d) 25

MCQ 10. Which for loop declaration is NOT valid? [1618505]


(a) for(int i=99; i>=0; i/9) ✓
(b) for(int i=7; i<=77; i+=7)
(c) for(int i=20; i>=2; --i)
(d) for(int i=2; i<=20; i=2*i)

★ MCQ 11. Which of the following is NOT a Java feature? [Repeated: 1618505, 2018503A]
(a) dynamic
(b) architecture neutral
(c) use of pointers ✓
(d) object oriented

■■ Unit 2 — Strings, Arrays & Keywords


MCQ 12. What is the return type of hashCode() in the Object class? [1618505]
(a) object
(b) int ✓
(c) long
(d) void

MCQ 13. Which creates a list of 3 visible items with multiple selection enabled? [1618505]
(a) new List(false,3)
(b) new List(3,true) ✓
(c) new List(true,3)
(d) new List(3,false)

MCQ 14. What are nameless objects? [1618505]


(a) object created using new keyword
(b) object of a superclass created in the subclass
(c) object without having any name but having a reference ✓
(d) object that has no reference

MCQ 15. What does dependency between objects mean? [1618505]


(a) tight coupling ✓
(b) cohesion
(c) loose coupling
(d) none of these

★ MCQ 16. In which memory is a string stored when created using new operator? [Repeated:
1618505, 2018503A]

(a) stack
(b) string memory
(c) heap memory ✓
(d) random storage space

■■ Unit 3 — Packages & Inheritance


★ MCQ 17. Which keyword accesses the features of a package? [Repeated: 1618505, 2018503A]
(a) package
(b) import ✓
(c) extends
(d) export

★ MCQ 18. Given ArrayList list = new ArrayList(); what is the initial quantity? [Repeated:
1618505, 2018503A]

(a) 5
(b) 10 ✓
(c) 0
(d) 100

★ MCQ 19. If a thread goes to sleep, it: [Repeated: 1618505, 2018503A]


(a) releases all the locks it has
(b) does not release any locks ✓
(c) releases half of its locks
(d) releases all of its lock except one

MCQ 20. Which interface is used to declare core methods in Java? [1618505]
(a) comparator
(b) EventListener
(c) set ✓
(d) collection

■■ Unit 4 & 5 — Exceptions, Threads & JVM


MCQ 21. What is the size of float and double in Java? [2018503A]
(a) 32, 64 ✓
(b) 64, 64
(c) 32, 32
(d) 64, 32

MCQ 22. Which component compiles, debugs and executes Java programs? [2018503A]
(a) JRE
(b) JIT
(c) JDK ✓
(d) JUM

MCQ 23. What is NOT a use of 'this' keyword in Java? [2018503A]


(a) Referring to instance variable when local variable has same name
(b) Passing itself to the method of the same class
(c) Passing itself to another method ✓
(d) Calling another constructor in constructor chaining

MCQ 24. Which exception is thrown when Java is out of memory? [2018503A]
(a) Memory error
(b) Out of memory error ✓
(c) memory out of Bound exception
(d) Memory full exception

MCQ 25. Which of the below is NOT a Java profiler? [2018503A]


(a) J profiler
(b) eclipse profiler
(c) JVM ✓
(d) J console

MCQ 26. Which one of the following is NOT an access modifier? [2018503A]
(a) Protected
(b) void ✓
(c) public
(d) private

MCQ 27. Which option leads to portability and security of Java? [2018503A]
(a) Bytecode is executed by JVM ✓
(b) The applet makes the Java code secure and portable
(c) Use of exception handling
(d) dynamic binding between objects

MCQ 28. Which is a valid declaration of a char? [2018503A]


(a) char ch = 'utea'
(b) char ca = 'tea'
(c) char cr = \u0223 ✓
(d) char cc = 'itea'

MCQ 29. Which tool generates API documentation in HTML format from doc comments? [2018503A]
(a) javap tool
(b) Javaw command
(c) Javadoc tool ✓
(d) javah command

MCQ 30. In which process does a local variable have the same name as an instance variable?
[2018503A]

(a) Serialization
(b) Variable shadowing ✓
(c) Abstraction
(d) multi-threading

★ = High Priority (Repeated in 2+ papers) | Green = Correct Answer | All 5 units covered as per SBTE Bihar Syllabus

You might also like