index_practical
index_practical
Practical-4
1 write a program that create following : a inherited by b ,b
inherited by c and c is inherited by d. a has one variable b has
two and c has 3 variables. Use constructor and super to
initialized the variables of classes.
2 Write a Java program that combine several classes and interfaces
the abstract class robot has subclass name robotA, robotB,
robotC. Class robotA1 extends robotA. Class robotB1 and
robotB2 extends robotB. Class robotC1 extends robotC. The
locomotion interface declares three methods has forward ,
reverse and stop. It is implemented by class robotB and robotC. 10 CO2
The sound interface declares one method named beep and it is
implemented by robotA1,robotB1 and robotC. Defined all class
and implement interface as specified than invoked beep method
of all class object that are of type sound.
3 write a program that has abstract class dim which has a two
variable dim1,dim2. triangle and rectangle are subclass of dim.
implement dynamic method dispatch by creating reference of
dim.
Practical-5
1 Write a java program to find solution of quadratic equation. Take
care of divide by zero error and other arithmetic exceptions
2 Write a program in which main() call a(),a() call b(),b() call c(),c()
call d(),d() genarates ArrayIndexOutOfBoundException. c and d
catch throw the Exception. b() handle an Exception. Each method
contain finally.
Practical -6
1 Write a Program for multithreading that finds prime number in
the range provided by user in command line argument
depending upon range creates sufficient number of child thread.
Practical-8
1 Implement singly linked list and its operations in java program