0 ratings 0% found this document useful (0 votes) 5 views 14 pages Java Paper
The document outlines the examination structure for the OOPS using Java course, including sections for objective questions, short answer questions, and detailed explanations. It covers various Java concepts such as constructors, exception handling, applets, and event handling, along with specific questions related to Java's object-oriented programming features. The document also includes sample questions and programming tasks to assess students' understanding of Java programming principles.
AI-enhanced title and description
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
(Printed Pages : 3) Roll No
AC-1942
B.E. IV Semester (New Course) Examination,
May- 2022
OOPS USING JAVA
CSE, ECE
Time : Three Hours | {Maximum Marks : 60
Minimum Marks : 24
Section - A (All questions are compulsory-objective Type/True & False)
1x10=10.
Section - B (Four Questions are compulsory out of Six) 5x4=20
Section - C (Three Questions are compulsory out of Five) 10x3=30
Ses limal
1. Anexpression involving byte, int, and literal numbers is premoted to which
of these?
& int (b) long
(c) byte (A) float
2. Which of the following option leads to the portability and security of Java?
(@J Byte code is executed by JVM
(b) The applet makes the Java code secure and portable
(c) Use of exception handling
(d) Dynamic binding between objects
3. What is true about private constructor?
a Private constructor ensures only one instance of a class exist at any
point of time
(b) Private constructor ensures multiple instances of a class exist at
any point of time
© (c) Private constructor eases the instantiation of a class
(d) Private constructor allows creating objects in other classes
P.T.O.4. What would be the behaviour if this() and super() used in a method?
(a) Runtime error (2) Throws exception ®
CG (©) Compile time error (d) Runs successfully
5. What is the process of defining more than one method in a class differen-
tiated by method signature?
G) Function overriding -((b}/ Function overloading
(c) Function doubling (d)_ None of the mentioned
6. Which of these is correct way of calling a constructor having no parame-
ters, of superclass A by subclass B?
(a) Super (void); (b) Superclass(); &
(c) Super.A(); (4) Super();
Give the abbreviation of AWT?
@) Applet Windowing Toolkit
(b) Abstract WindowWing Toolkit ©
(c) Absolute Windowing Toolkit
(d) None of the above
, we ‘
8. Which object can_be. constructed to show any number of choices in the
~
visible window? is oe
{a) Labels (b). Cheice
(©) List gia + (A) -Gheckbox
©
Which are passive controls that do not support any interaction with the
user?
(a) Choice lb) List
(cy labels (d)* Checkbox
10. Which of these-keywerds is used to bythe calling function to guard against
the exception that is thrown by called function?
() ty Q
am) ©
(c) theews c-7
(d) catch
AC-1942 (2)Y
ac-19042
each of them with suitable exampl
le.
Define
an interface. What is the need for an énterface?
What is container? What are the different types of components in AwT?
Write @ program in java [Link] different com
ponents and add them into
a container.
What is an exception? What do you understand. by checked and Un-
checked exception?
What are constructors? Explain different types of constructor with exam-
ple.
Section-c
What is object casting? How it can be achieved? Mention the different
rules to type cast an object. Demonstrate object type casting with suit-
able java program.
What is an Applet? How it differs from an Application? Explain life cycle of
an Applet. Write a code in Java to demonstrate the fifé cycle of an Applet.
Explain life cycle of a thread with the help of diagram. Write a code in java
to demonstrate the life cycle of a’thread. 7
Explain the following terms'with'suitable example:
(a) Claiming an exception woN to yea
(b) throwing an exception
(c) catching an exception
What is an event? How events are handled? Write the procedure to handle
a button click event with proper ‘programming syntax in Java.
(3)(Printed Pages : 3) Roll No. .2194.49.S21.1 914
AC-592
B.E. IV Semester (New Course) (Main & Re)
Examination, May-2023
(Held in August 2023)
OOPS USING JAVA/JAVA
CSE, ECE
Time : Three Hours ] [Maximum Marks : 60
[Minimum Marks : 24
Note : Section-A : All questions are compulsory (Objective type /True &
False) (1x10=10 Marks) Section-B: Four questions are compulsory
out of six (5x4=20 Marks), Section-C: Three questions are
compulsory out of five (10x3=30 Marks).
Section-A
Objective Type/True & False. 1x10=10
1. Who developed object-oriented programming?
(a) Dennis Ritchie (b) Alan Kay
(c) Adele Goldberg (d)_ Andrea Ferro
2. The concept of encapsulation helps in writing which type of classes in the
Java programming language?
(a) Abstract classes (b) Mutable classes
(c) Wrapper classes (4) Immutable classesWhat is the range of short data type in Java?
(a) 128 to 127 (b) -2147483648 to 2147483647
(c) ~32768 to 32767 (d) None of these
What is the process of defining more than one method in a class
differentiated by method signature?
(a) Function overriding (b) Function overloading
(c) Function doubling (d)_ None of the mentioned
Which of these keywords in used to make a class?
(a) Class (b) struct
(c) int (d) none of the mentioned
Which of these access specifiers can be used for an interface?
(a) Public (b) Protected
(c) Private (d) All of the mentioned
AWT is used for GUI programming in java.
(a) True (b) False
The Action Listener interface is not used for handling action events.
(a) True (b)_ False
Which of these keywords is used to generate an exception explicitly?
(a) try (b) finally
(c) throw (d) catch
|. Which of these method of Thread class is used to Suspend a thread for a
period of time?
(a) Sleep() (b) Terminate ()
(c) Suspend () (4) Stop ()
AC-592 (2)Section-B
Four Questions are compulsory out of Six 574=20
List out the operators used in Java.
What is a String in Java? What is the difference between a String in Java
and String in C/C++?
Differentiate between method overloading and method overriding.
What is the difference between Swing and AWT?
Describe about switch statement with diagram. Write a program in java to
demonstrate the switch-case flow control.
Write about following methods in brief:
(a) Start ()
(b) Yield ()
Section-C
Three Questions are compulsory out of five. 10x3=30
Explain working of Java Virtual Machine (JVM). Also explain how java is
architectural neutral.
What are destructors? How is object destruction done in Java? Explain
with suitable example.
Explain Packages in detail. Mention different classes present in UTIL
package.
List out different interfaces to handle events in AWT. Demonstrate different
interfaces with suitable java program.
Explain life cycle of a thread with the help of diagram. Write a code in java
to demonstrate the life cycle of a thread.
AC-592 (3)(Printed Pages : 4) Roll No
AC-1540
[Link] Semester (Main & Re.)
Examination, May-2024
CSE, ECE
OOPS USING JAVA/JAVA
Time : Three Hours | | Maximum Marks : 60
[Minimum Marks : 18
Note : Section-A : All questions are compulsory (Objective type/True &
False) 1x10=10
Section-B : Four questions are compulsory out of six. 5x4=20
Section-C : Three questions are compulsory out of five. 10x3=30
Section-A
1. Command Line Arguments are received in main method as:
(a) int
(b) float
(c) Integer
(d) String
2. JDK include :
(a) Only a runtime environment
(b) Only a compiler
(c) Both a compiler and a runtime environment
(d) None of the above
P.T.0.3. What is the result of the following block of code?
(a)
(b)
(c)
(d)
{ float a = 10.5;
int b =a;
[Link](b);}
10.0
10
10.5
Compile-Time error
4. Correct syntax for creating instance of class “Myclass”:
(a)
(b)
(c)
(d)
Myclass = Myclass();
Myclass = new Myclass;
Myclas obj = MyClass;
new Myclass();
5. Which of the following is not a primitive data type in Java?
(a)
(b)
(c)
(d)
Integer
int
double
boolean
6. What is inheritance in Java?
(a)
(b)
(c)
(d)
The process of creating multiple instances of a class
The process of hiding data and methods within a class
The process of reusing code from existing classes
The process of combining data and methods into a single unit
7. What does the finally block do?
(a)
(b)
(c)
(a)
AC-1540
Catches any exception
Executes whether an exception is thrown or not
Executes only when an exception is thrown
Executes only when an exception is not thrown
(2)8. Which of these is a checked exception?
(a) Null Pointer Exception
(b) Arithmetic Exception
(c) 10 Exception
(d) Index Out of bounds Exception
9. What invokes immediately after the start() method and also any time the
applet needs to repaint itself in the browser?
(a) Stop()
(b) init()
(c)_ paint()
(d) destroy()
10. Which interface is implemented to activate Button in awt:
(a) ActionListener
(b) KeyListerner
(c) MouseListener
(d) ItemListener
Section-B
1. Describe JDK, JVM & JRe in java.
2. _ Explain fundamentals of Object-oriented Programming languages,
3. What are constructors. Write the properties of constructors. Explain
different types of constructor with suitable example.
4. What are different variables used in Java? Differentiate Class Variables &
Instance variables using suitable example.
5. Define String in Java? Differentiate String objects and string Literals. What
is the concept of Constant string pool in Java?
6. Define abstract classes and interfaces in Java?
AC-1540 (3) P.T.0.Section-C
1. Describe the structure of Java program. Write a. program, to create
complex class with following details:
Class : Complex
int real, img;
Complex();
Complex(int,int);
Complex(Complex);
Complex add (Complex);
void display() //_in atib format
write a main function to perform addition of two complex objects.
2. What is inheritance? How to inherit a class in java? Describe the role of
super keyword in inheritance.
3. What are Exceptions in java? Differentiate Checked & Unchecked
Exceptions. Describe all keywords used in exceptions handling with
suitable example.
4. What is applet in java? Define life cycle of an applet. How to pass
parameters to Applet.
5. What is event handling in java? Write a program using awt to perform
event handling while pressing a Button placed in a frame.
ACc-1540 om(Printed Pages : 4)
AC-827
B.E. IV Sem. Main & Re- Examination, May-2025
OOPS USING JAVA/JAVA
Branch : CSE, ECE
Time : Three Hours | [Maximum Marks : 60
[Minimum Marks : 18
Note : Section (A) - Attempt all Ten Questions (1x10=10 Marks), Section
(B)- Attempt 04 Question out of 06 Question (5x4=20 Marks), Section
(C)- Attempt 03 Question out of 05 Question (10x03=30 Marks).
Section-A
eA Which of the following is not oops concept in Java
(A) Inheritance
(8) Encapsulation
(C) Poly morthism
\§2) Compilation
2: Mihich concept of Java is achieved by combining methods and attributes
into the class.
(A) Encapsulation
(B) Inheritance
(C) Polymorthism
(0) Abstraction —
P.T.O.Le
When does method overloading is determined?
(A) Run Time =
(B) Compile Time
(C) Coding Time
(D) Execution Time
When Child object get killed if parent object is killed then it is known as--
(A) Aggregation
(8) Composition
(C) Encapsulation
(D) Association ,
Which of there can not be variable name in Java?
(A) Identifies & Keywords
(B) Identifies
(C) Keywords
(D) Variables
Which environment variable is used to set the Java path?
(A) MAVEN-PATH
(B) JAVA-PATH
(C) JAVA
(D) JAVA-HOME
Which of these are selection statements in JAVA?
(A) Break
(B) Continue
(C) For ()
(D) If ( _
AC-827 (2)8. Which of the following key words is used to define interface in JAVA?
(A) int
(8) Int t
(C) interface
(D) Interface
4. Which of the following is not JAVA profiler?
(A) 3 Profiler
(B) Eclipse Profiler
(C) VM
(D) J-Console
* Which one of the following is not an access modifier?
(A) Protected
(B) Void
v
(C) Public
(D) Private
Section - B
& Discuss Fundamental Concepts of object oriented programing. 2
sit
x Explain the Concept of Polymerthism in JAVA.
3/7, Differentiate between overloading and over riding
Aan Inheritance with suitable example.
5. What is the need of OOPS?
ain in the concept of constructor and destructor in JAVA.
bol
@)
AC-827Section - C
a What do you mean by thread life cycle and methodsin JAVA.
2,
‘What is applet in JAVA? Define life cycle of an applet. &3
Ne
Y How Event handing done in JAVA. Illustrate your answer.
4.
5.
Write a program in Java to explain the concept of polymorthisms.
How you can write GUI programs in JAVA. Write JAVA code to make a GUI
which includes border layout buttons and Schull bar.