Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views6 pages

Programming With Core Java

The document is an examination paper for the B. Tech. (CSE) Third Semester course on Programming with Core Java, consisting of three sections: very short answer questions, short answer questions, and long answer questions. It covers topics such as Java features, object-oriented programming concepts, exception handling, and multithreading. Each section requires students to demonstrate their understanding and application of Java programming through various types of questions and programming tasks.

Uploaded by

Nitin Kumar
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)
6 views6 pages

Programming With Core Java

The document is an examination paper for the B. Tech. (CSE) Third Semester course on Programming with Core Java, consisting of three sections: very short answer questions, short answer questions, and long answer questions. It covers topics such as Java features, object-oriented programming concepts, exception handling, and multithreading. Each section requires students to demonstrate their understanding and application of Java programming through various types of questions and programming tasks.

Uploaded by

Nitin Kumar
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
You are on page 1/ 6

Roll No. …………………..

TCS–305
B. Tech. (CSE) (Third Semester)
EXAMINATION, 2023-24
PROGRAMMING WITH CORE JAVA
Time : Three Hours
Maximum Marks : 60
Note : Question paper has three Sections. Read carefully
instructions for each Section.
Section—A
(Very Short Answer Type Questions)

1. Attempt all questions : 1 each


(a) What is Java, and what are some key features of
the Java programming language ? (CO1, RE)
(b) How do you declare a variable in Java ?
(CO1, RE)
(c) What is the difference between primitive data
types and reference data types in Java ?
(CO1, RE)

P. T. O.
[2] TCS–305

(d) How do you declare a subclass in Java, and what


keyword is used for inheritance ? (CO2, UN)

(e) Explain the purpose of using interfaces in Java.


(CO2, UN)
(f) What is Method overloading ? (CO2, UN)
(g) Why is exception handling important in
programming ? (CO3, UN)
(h) Explain the difference between checked and
unchecked exceptions in Java. (CO3, UN)
(i) What is the difference between Process and
Thread ? (CO4, UN)
(j) What are the benefits of using multithreading in
Java applications ? (CO4, UN)
(k) What is an event handler, and what is its role in
responding to events ? (CO5, UN)
(l) What is the Java Swing, and how does it relate to
event handling in Java ? (CO5, UN)
Section—B
(Short Answer Type Questions)

2. Attempt all questions : 4 each


(a) Explain the concept of encapsulation in OOP.
(CO1, UN)
[3] TCS–305

OR

How do you create and use objects in Java ?


Explain the significance of the “public static void
main(String[] args)” method in Java.

(b) Discuss the differences between the “public,”


“private,” “protected,” and “default” access
modifiers in Java. (CO1, UN)

OR

What is a Java package, and how does it help in


organizing code ? (CO1, UN)

(c) How does the concept of “interface” support


multiple inheritance in Java ? (CO2, AP)

OR

What is inheritance in Java, and why is it a


fundamental concept in object-oriented
programming ? (CO2, AP)

(d) What is the purpose of the try, catch, and finally


blocks in exception handling ? (CO3, AP)

OR

What is the purpose of the BufferedReader and


BufferedWriter classes in Java I/O ? (CO3, AP)

P. T. O.
[4] TCS–305

(e) What is the “wait-notify” mechanism in Java, and


how is it used for inter-thread communication ?
(CO4, AN)
OR
What are different states in lifecycle of Thread ?
(CO4, AN))
(f) How does the AWT (Abstract Window Toolkit)
library utilize event-driven programming for
building graphical user interfaces ? (CO5, AN)
OR
Discuss about Source, Event and Listeners in
event handling. (CO5, AN)
Section—C
(Long Answer Type Questions)

3. Attempt all questions : 8 each


(a) Write difference between a JDK and a JVM.
Develop a Java program that simulates a simple
calculator. Allow the user to enter two numbers
and an operator (+, –, *, /) , and then perform the
calculation and display the result. (CO1, CR)
OR
What is the argument of main() method ?
Develop a Java program that converts a
[5] TCS–305

temperature in degrees Celsius to degrees


Fahrenheit. Prompt the user to input a
temperature in Celsius, perform the conversion,
and then display the result in Fahrenheit using the
formula : Fahrenheit = (Celsius * 9/5) + 32.

(CO1, CR)
(b) Define inheritance and its type. Write a Java
program that demonstrates inheritance by
defining a superclass “Animal” and two
subclasses “Bird” and “Mammal.” The “Animal”
class should have a method called “makeSound,”
and each subclass should provide its own
implementation of this method to represent the
sound that the specific animal makes.
Additionally, each subclass should have a unique
property or behavior related to the type of animal
it represents. (CO2, CR)

OR

Define ArrayList and why ArrayList is differ


from Array ? Write a Java program to
demonstrate the use of ArrayList for managing a
list of students’ names. Create an ArrayList to
store student names, allow the user to add new

P. T. O.
[6] TCS–305

names, remove names, and display the list of


names. Use a menu-driven approach to interact
with the ArrayList, and provide options for
adding, removing, and displaying names. The
program should continue running until the user
chooses to exit. (CO2, CR)

(c) Explain Exception hierarchy in details. Create a


Java program that reads two numbers from the
user and performs division. Implement exception
handling to handle division by zero. If the user
attempts to divide by zero, catch the exception
and display an error message. Otherwise, display
the result of the division. The program should
handle exceptions gracefully and not crash.

(CO3, CR)

OR

What is Scanner class ? when was it introduced in


Java ? Create a Java program that writes data to a
text file. Allow the user to input lines of text, and
then write those lines to a file. (CO3, CR)

TCS–305 460

You might also like