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

0% found this document useful (0 votes)
18 views2 pages

Java Paper

This document is an examination paper for the Object Oriented Programming Through Java course at KKR & KSR Institute of Technology and Sciences. It consists of two parts: Part-A with compulsory short answer questions and Part-B with detailed questions from various units. The exam covers topics such as object-oriented programming concepts, Java programming, exception handling, and GUI components.

Uploaded by

hanusmurukutla
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)
18 views2 pages

Java Paper

This document is an examination paper for the Object Oriented Programming Through Java course at KKR & KSR Institute of Technology and Sciences. It consists of two parts: Part-A with compulsory short answer questions and Part-B with detailed questions from various units. The exam covers topics such as object-oriented programming concepts, Java programming, exception handling, and GUI components.

Uploaded by

hanusmurukutla
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/ 2

Code No. : 23CS3T02 R23 H.T.No.

J R

KKR & KSR INSTITUTE OF TECHNOLOGY AND SCIENCES


(AUTONOMOUS)
II-B.Tech I-Semester Regular Examinations, December-2024
Subject : Object Oriented Programming Through Java
(Common toCSE,IT,CSM & CAI)
Time : 3 Hours Max. Marks: 70
Question Paper Consists of Part-A and Part-B
Answering all the questions in Part-A is Compulsory (10 x 2 = 20)
Answer any one complete question from each unit(5 x 10 = 50)
Present your answers with NEAT sketch wherever is necessary.
Part-A
1. a How an abstract class is different from an interface? 2M
b What is an event in AWT? 2M
c Differentiate between static and instance variables of a class. 2M
d How many String objects will be created? 2M
String S1 = new String("Java"); String S2 ="Program"; S1 = S1 + S2;
e Differentiate between method overloading and method overriding. 2M
f List out the characteristics of the constructor. 2M
g Explain length and length() with a suitable example. 2M
h What do you mean by upcasting? Explain with an example. 2M
i Define “autoboxing” and “unboxing” with an example. 2M
j Write an AWT program to create two radio buttons “male” and “female”. 2M
Part-B
UNIT -I
2. (a) Explain the basic characteristics of object-oriented programming. Write a program to read a number 5M
using a command line argument and check whether it is even or odd.
(b) Write a program to display all the prime numbers between 1 and 100. 5M
[OR]
3. (a) Explain the architecture and components of JVM with a neat diagram. 5M
(b) Write a program to receive a color code (an alphabet) from the user. The program should then print the 5M
color name, based on the color code given. The following are the color codes and their corresponding
color names.
R->Red, B->Blue, G->Green, O->Orange, Y->Yellow, W->White. If the color code provided by the
user is not valid then print "Invalid Code".
UNIT – II
4. (a) What is constructor chaining? Explain with a suitable example. 5M
(b) Write a program to define a user-defined method that will take an integer as its argument and find out 5M
the reverse of that number. Develop a main() method to test the method.
[OR]
5. (a) Explain the difference between call by value and call by reference with a suitable example. 5M
(b) Explain any three usages of this keyword with a suitable example. 5M
UNIT – III
6. (a) Explain the usage of super keyword with suitable examples on each. 5M
(b) Write a program to initialize an integer array with values and check if a given number is present in the 5M
array or not. If the number is not found, it will print -1 else it will print the index value of the given
number in the array.
[OR]
7. (a) Explain the concept of dynamic method dispatch with a suitable example. 5M
(b) How the final keyword can be used in inheritance. Explain with suitable examples. 5M
UNIT – IV
8. (a) Write a program to create two threads, one to display all even numbers between 1 & 20 and another to 5M
display odd numbers between 1 & 20.
Note: Display all even numbers followed by odd numbers
Code No.23CS3T02 Page 1 of 2
(b) What is a user-defined Exception in Java? Write a program to accept student age and check whether he 5M
is eligible to vote or not (Using user-defined exception).
Note : Show an appropriate message when the age is not eligible.
[OR]
9. (a) Write a program to copy the contents of “source.txt” into another file “target.txt”. 5M
(b) What is synchronization? Explain the role of the synchronized method with a suitable example. 5M
UNIT – V
10. (a) Write a program to create two checkboxes named “JAVA” and “PYTHON”. Design two labels that will 5M
display checkbox contents when selected.
(b) Write a program to input 2 numbers into two TextFields. Display the sum of them in another Text Field 5M
when the button is clicked.
[OR]
11. (a) Write a java program that will return the first half of the string, if the length of the string is even. 5M
It should return null if the length of the string is odd.
Example – 1: Input : TomCat Output: Tom
Example –2: Input : Apron Output: null
(b) What is the difference between the String and String Buffer class? Write a program to check whether a 5M
string is palindrome or not (only using String class methods).

Code No.23CS3T02 Page 2 of 2

You might also like