0 ratings0% found this document useful (0 votes) 27 views13 pagesJava Programming
Java sample questions amity university
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
[No. of Printed Pages — 3]
SES2
17201 Enrol. No. .....
(ET)
SUPPLEMENTARY EXAMINATION : JUNE 2022
JAVA PROGRAMMING
Time: 3 Hrs. Maximum Marks : 60
Note: Attempt questions from all sections as directed.
SECTION - A (24 Marks)
Attempt any four questions out of five.
Each question carries 06 marks.
1. What is the object oriented paradigm? State four
Features of Java.
2. (a) Write a program to implement the Fibonacci series
using for loop control structure. (3)
(b) Describe the following methods related to String
(i) replace()
(ii) compareTo()
Gi) charAt() 6)
P.T.O.
Trt a | -
@ scanned with OKEN ScannerSES2, y1201 3
SEs2
17201 [access Mositirs available in java? (b) Deseride the uses of Final and super keywords
3, Discuss ers eect te visibility of @ member eee .
ers €
~ So
in di
SECTION - C ee
sefis of using Packages? Write down
a package and using it in Java (Compulsory)
ating
9, (a) Create a class Train inherited from Super fast
ceptions? How are exceptions Train class. Define proper constructor for both of
jth suitable example?
out ex
the classes and methods to collect and display
va explain W
data of passengers . Show the example using
SECTION - B (20 Marks) virtual base class. 8)
any two questions out of three. (b) Write an applet for each of following graphics
question carries 10 marks. methods. drawoval(), drawrect(), drawline(),
filloval().
6 is multithreading? Explain the steps for ®
ing thread in Java. ©)
(b) Explain life cycle of thread with an example.
6)
1, ‘Some Useful Annotations from the Standard
" at is layout manager ? Explain the Flow Lay
Border Layout with a suitable example. (5)
(100)
@ scanned with OKEN Scannervu
vu
LULLLLLLLLLLUUULUUUOULOTTE
INo. of Printed Pages — 3 ORS
TT201 Enrol, No. jcc
[ET]
END SEMESTER EXAMINATION : April-May, 2023
JAVA PROGRAMMING
Time > 3) Hrs, Maximum Marks » 60
Note
Attempt questions from all sections as dir
SECTION — A (24 Marks)
Attempt any four questions out of five.
Each question carries 06 marks.
1. Explain the various features of Java, Why is Java
known as platform-neutral language? Explain.
2. Explain the importance of event handling mechanism,
What is delegation event model? Explain with
examples.
3. What are the various java annotations and its types?
Write a program to create custom annotations.
P.T.O,
@ scanned with OKEN Scanner; 17201 2
4. Write @ program t0 explain the dittereg,
abstract classes and final classes betveey Tr201 3 oss
SECTION-C a6 Marks)
5. What are the various types of inheritances ee,
Upon,
cd
by Java? How is multiple inherit
‘ance iny
Plemened ig 9. (@) Write a program to display the ereation of teads
Java?
in two different ways. ®)
(b) Create a class Box in a package Mypackage with
its length, breadth and depth. Provide appropriate
Constructors), which pass value of length, breadth
SECTION - B 20 Mar
rks)
Attempt any two questions out of three
Each question carries 10 marks ae seal : ae uae
methods to calculate volume and to display al
information of Box. Design different class TestBox
class which is not in Mypackage package, and
CCCcccee
6 Explain the life eycle of a thread. Write a program to
which will contain main function, From this main
implement thread priorities, ‘eae
a function, create two Box objects by taking all
is ir . necessary information. @)
7. What is maven? Explain the Maven Life cycle in a mY,
detail. be
8. Explain the significance of the following in detail: So)
as
(i) Event Listeners ;
(ii) Layout Managers “se
“~~
“
(1200)
=
@ scanned with OKEN Scanner4 1820
17201
+ custNam
fe must be atleast of 4 characters
category must be either ‘Platinum’, ‘Gold’ or ‘Silver:
when any of these validations fail, then raise &
user defined exception {nvalidInputException
estCustomer having main method.
Create a class T
Create an
‘Ask user to enter customer details.
{form validations. Print
object of Customer and per
details of customer.
7, Asset of 5 words are given: Write a program to reverse
each word and arrange the resulting words in
alphabetical order. Explain the following terms:
(i) super
(ii.) finalize() method
jii.) object class
ym to design a GUI based Calcul
a prograi
cation which perform addition, subtracti
plication and division operation on integers?
5 1820
17201
SECTION - C (16 Marks)
(Compulsory)
(a) Create a class named Movie that can be used
with your video rental business. The Movie class
should track the Motion Picture Association of
America (MPAA) rating (e.g., Rated G, PG-13,
R), ID Number, and movie title with appropriate
accessor and mutator methods. Also create an
equals() method that overrides Object 's equals()
method, where two movies are equal if their ID
number is identical. Next, create three additional
classes named Action , Comedy, and Drama that
are derived from Movie . Finally, create an
overridden method named caleLateFees that takes
fas input the number of days a movie is late and
returns the late fee for that movie. The default
late fee is $2/day. Action movies have a late fee
of $3/day, comedies are $2.50/day, and dramas
are $2/day. Test your classes from a main method
(8)
P.T.0.
@ scanned with OKEN ScannerT201 2
3. Assume that you are running a courier service faci
Bach parcel user wants to send needs to ha
certain number of stamps. The number of stat
depends upon the weight of the parcel, Create a el
to accept weight of five parcels in floating-point valug
‘Assume by your own range of weights and
corresponding number of stamps to be spend. The
cost of each stamp is Rs. 15 each per kg, Also, there
js an amount charged by the courier company also
depending upon the location of the courier to be
delivered. For national courier, charges are Rs 50,
for courier to be delivered in the same city charges
are Rs30. Write a computer program to calculate and
display the total cost of each parcel depending upon
the number of stamps required to spend on each parcel
and location of courier.
Discuss some general rules for using layout managers, _
Deserive the various layout managers available in
AWT? 4
17201 3 1820
5. If'auser creates two threads in a program, how many
threads are actually running? Explain the complete
flow of execution of a thread in a program along with
its life cycle.
SECTION - B (20 Marks)
Attempt any two questions out of three.
Each question carries 10 marks.
6. Can derived class object be assigned to a base class
reference variable? How this concept is useful in
Dynamic Method Dispatch? Explain with Example?
Create a class Customer having following members:
private String custNo private, String custName, private
String category Parameterized constructor to initialize
all instance variables Getter methods for all instance
variables Perform following validations in the
constructor
+ custNo must start 'c' or
P.T.O.
a
@ scanned with OKEN Scanner[No. of Printed Pages — 6] 1820
1T201 Enrol. No. ...
(ET]
END SEMESTER EXAMINATION : NOV-DEC 2022
JAVA PROGRAMMING
Time : 3 Hrs. Maximum Marks : 60
Note: Attempt questions from all sections as
directed.
SECTION - A (24 Marks)
Attempt any four questions out of five.
Each question carries 06 marks.
1. Discuss various types of access modifiers available
in java. How access modilfier effect the visibility of
a member in various access locations?
2. Differentiate between the following:
(i) throw vs throws
(ii) multithreading vs multiprocessing
P.T.O.
@ scanned with OKEN Scanner4. Explain the importance of event hand 11201 “5
in applet programming. What i
model? SECTION - C (a6 Marks)
(Compulsory)
: 3
5. Write a program using constructors: 5, (a) Write a Java program by using BufferedReader
class to prompt a user to input his/her name
example
the following
and then the output will be shown as an
(a) To convert the lower @aseust below
case.
Hello ' )
(b) To compare two strings.
7 (b) Create the following class hierarchy in your
program, Make suitable assumptions for data
members, constructors, methods and demonstrate
SECTION = B
Wing two questions out’
the working of each class.
tion carries 10
Inheritance in Java
wh
‘Rutomabiles >)
Strainer,
\ \
bs) 2)
6)
(1000)
(806)
© Scanned with OKEN Scanner0. of Printed Pages — 3]
201
iT}
END SEMESTER EXAMINATION : APRIL-MAY 2022
JAVA PROGRAMMING
60
ime; 3 Hrs. Maximum Marks :
ote: Attempt questions from all sections as directed.
SECTION - A (24 Marks)
Attempt any four questions out of five.
Each question carries 06 marks.
m. Also
4. Explain thread life cycle with a neat diagrar
explain thread priorities.
Explain the architecture of an applet with the help of
an example.
Explain the following :
Maven build Li e
(a) vi ui ifecycle (3)
b) Project Obj 5
(b) Projec' ject Model (3)
Peo:
(806)
@ scanned with OKEN Scanneryr201 portance of event handling mee} 17201 ys
im —
re ramming. What is delegation
Jet prow! SECTION —~ c (16 Marks)
(Compulsory)
a
Bg constructors 19am (2) Write 2 Java program by using BufferedReader
rogral
lass to prompt a user to input
her name
‘and then the output will be shown as an example
he lower case string below :
vert t
Hello ! (8)
are two stri (b) Create the following class hierarchy in your
Program. Make suitable assumptions for data
members, constructors, methods and demonstrate
the working of each class,
Inheritance in Java
7. Explain the exception handlin
AVA. What is finally BlOe
sed? Give suitable example,
Explain the types of aim
stam to describel ROWE
annotations
(1000;
(806)
@ scanned with OKEN Scanner[No. of Printed Pages ~ 3]
11201
[ET] EnrolseNoe s.r
ENL
) SEMESTER EXAMINATION : APRIL-MAY 2022
JAVA PROGRAMMING
Time: 3 Hrs. Maximum Marks ; 60
Note: Attempt questions from all sections as directed.
SECTION - A (24 Marks)
Attempt any four questions out of five.
Each question carries 06 marks.
1. Explain thread life cycle with a neat diagram. Also
explain thread priorities.
2. Explain the architecture of an applet with the help of
an example.
3. Explain the following :
(a) Maven build Lifecycle @)
(b) Project Object Model (3)
Pal.O.
(806)
@ scanned with OKEN ScannerSES2
2
Modifiers ®
ct the visibility of a member
Te itable in java?
3. Discuss vari
How access .
in different one
4. What are the sing Packages? Write down
the steps of ol
program with
rackage and using it in Java
ns? How are exceptions
jth suitable example?
-B (20 Marks)
Attempt any ns out of three.
Each ques jes 10 marks.
6. (a) What is mult Explain the steps for
ing threa (6)
cre
id with an example,
()
ions from the Standard
8. (a) What is layout
and Border Lay
lain the Flow Layout
itable example, (5)
yr20t
{) Describe the uses of final and
with respect to inheritance,
SECTION - C
(Compulsory)
9
data of passengers . Show th
virtual base class.
filloval().
@ scanned with OKEN Scannerpewrrwrevuwrwewewewzweewwew w
[No. of Printed Pages ~ 3]
SES2
17201 Enrol. No. .
SUPPLEMENTARY EXAMINATION : JUNE 2022
JAVA PROGRAMMING
3 Hrs Maximum Marks : 60
Note: Attempt questions from all sections as directed.
SECTION - A (24 Marks)
{ttempt any four questions out of five.
Each question carries 06 marks.
1. What is the object oriented paradigm? State four
Features of Java.
2. (a) Write a program to implement the Fibonacci series
using for loop control structure. (3)
(b) Describe the following methods related to String
(i) replace()
(ii) compareTo()
(iii) charAt() G)
P.T.O.
@ scanned with OKEN Scanner
You might also like
Object Oriented Programming With Java Aut, Cse, Civ, Che, Ele, Etc, Mec, Mme, Pe 3rd 21 22
Object Oriented Programming With Java Aut, Cse, Civ, Che, Ele, Etc, Mec, Mme, Pe 3rd 21 22
2 pages