0% found this document useful (0 votes)
4 views1 page

Java Practical Exercises and Solutions

The document is an index of Java practical assignments with corresponding dates and tasks. It includes various programming exercises such as swapping numbers, printing Fibonacci sequences, and implementing classes and interfaces. The assignments cover fundamental Java concepts and exception handling.

Uploaded by

yangleng18
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)
4 views1 page

Java Practical Exercises and Solutions

The document is an index of Java practical assignments with corresponding dates and tasks. It includes various programming exercises such as swapping numbers, printing Fibonacci sequences, and implementing classes and interfaces. The assignments cover fundamental Java concepts and exception handling.

Uploaded by

yangleng18
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

JAVA PRACTICALS INDEX

Sr
No
DATE PRACTICAL SIGNATURE

i. Write a Java class to swap two numbers without using third variable.
1 26-04-25
ii. Write a Java class to print the Fibonacci sequence till 100

Write a Java program for the following scenario: Run a loop from 1 to 100, while looping when the
2 26-04-25
number is even print its square and when the number is odd print its cube.

Write a class MathDemo with methods square() with one parameter and add() with two
3 26-04-25
parameters. Call these methods to get the output.

Write a Java class for following methods display() -- Display number from 1 to 100 using while loop
4 28-04-25
in Java fibonacci() -- Prints Fibonacci series till 100

5 28-04-25 Write a Java Program to convert “25” to Primitive as well as Wrapper.

6 28-04-25 Write a Java program to convert 110011 to decimal value.

7 28-04-25 Write a Java Program to convert the “59” to Primitive float (without using Constructor of Float)

Write a class User with abstract methods pay() and receive(), later make two concrete class
8 28-04-25
GoldUser and SilverUser, override the abstract method.

Write a Java program to write the following, class A with method m1( ) and m2( ) and write a class B
9 28-04-25
with methods m3( ) and m4( ), Override the methods of A in class B.

Make an Interface CE which have methods call(), sms (), Make another interface ISO which have
10 02-05-25 methods radiation() and sound(). Make two classes IPhone and Galaxy and make them implement
both the interfaces.

Write a Java program to make a package [Link], make classes Circle and Square in
11 02-05-25
the same package.

Write a Java Program to make an Exception AgeException. When user passes some age and
12 02-05-25
if age is less than 18 throw this Exception.

You might also like