You are on page 1of 2

PRACTICAL LIST for JAVA

1 WAP to find the average and sum of the N numbers Using Command line
argument.
2 WAP to Demonstrate Type Casting.
WAP to find the number of arguments provide at runtime.
! WAP to Test the Prime number.
" WAP to #al#ulate the $imple %nterest and %nput by the user.
& WAP to #reate a $imple #lass to find out the Area and perimeter of re#tangle
and bo' using super and this (ey)ord.
* WAP to find +.C.D of the number.
, WAP to design a #lass a##ount using the inheritan#e and stati# that sho) all
fun#tion of ban( -)ithro)al. deposite/.
0 WAP to find the fa#torial of a given number using 1e#ursion.
12 WAP to design a #lass using abstra#t 3ethods and Classes.
11 WAP to design a $tring #lass that perform $tring
3ethod-45ual.1everse the string.#hange #ase/.
12 WAP to handle the 4'#eption using try and multiple #at#h blo#(.
1 WAP that %mplement the Nested try $tatements.
1! WAP to Create a pa#(age that a##ess the member of e'ternal #lass as )ell as
same pa#(age.
1" WAP that import the user define pa#(age and a##ess the 3ember variable of
#lasses that Contained by Pa#(age.
1& WAP that sho) the partial implementation of %nterfa#e.
1* WAP to 6andle the user defined 4'#eption using thro) (ey)ord.
1, WAP to #reate a thread that %mplement the 1unable interfa#e.
10 WAP to %mplement %nterthread #ommuni#ation.
22 WAP to #reate a #lass #omponent that sho) #ontrols and event handling
on that #ontrols.-math #al#/.
21 WAP to Dra) the line. 1e#tangle. oval.te't using the graphi#s method.
22 WAP to #reate a 3enu using the frame.
2 WAP to #reate a Dialogbo'.
2! WAP to %mplement the flo) layout And 7order 8ayout.
2" WAP to %mplement the +rid8ayout. Card8ayout.
2& Wap of A)tdemo2 given by me.
2* WAP to demonstrate $ystem #lo#(.
2, WAP to #reate 9rame that display the student information.
Java Lab Solution
Program 1: Print Message.
#lass firstprogram
:
publi# stati# void main-$tring arg;</
:
$ystem.out.println-=this is >ava?s first program=/@
A
A
Ee!ution ste"s:
Bava# firstprogram.>ava -9ile name/
Bava firstprogram -#lass name/
Program #: WAP to find the average.sum.min and ma' of the N numbers Using user
%nput.
import >ava.util.C@
#lass Average:
publi# stati# void main-$tring args;</
: $#anner s#D ne) $#anner-$ystem.in/@EE to ta(e user input
int #hoi#e@
int aD2.minD2.ma'D2.'@
int n Dargs.length@
$ystem.out.println-=1Fsum=/@
$ystem.out.println-=2FAverage=/@
$ystem.out.println-=F3inimum=/@
$ystem.out.println-=!F3a'imum=/@
$ystem.out.println-=4nter Ur Choi#e G =/@
#hoi#eDs#.ne't%nt-/@
for-int iD2@iHn@iII/:
aID%nteger.parse%nt-args;i</@EEto #onvert string into %nteger
A
s)it#h-#hoi#e/
:
#ase 1 G$ystem.out.println-=The sum is G =Ia/@
brea(@
#ase 2 G$ystem.out.println-=The Average is G =IaEn/@
brea(@
#ase Gfor-int iD2@iHnF1@iII/
: 'D%nteger.parse%nt-args;i</@
if-'H%nteger.parse%nt-args;iI1<//

You might also like