Lab Java MyRMwhFBL
Lab Java MyRMwhFBL
Lab Java MyRMwhFBL
1) Write a Java program Create abstract class shape. Drive three classes sphere. Cone
and cylinder from it.
Calculate Area and volume of all (use method overriding)
------------------------------------------------------CUT----------------------------------------------------
1) Write a Java program to convert the temperature in Centigrade to Fahrenheit
Write a Java program to create an interface Shape with the getArea() method.
2) Create three classes Rectangle, Circle, and Triangle that implement the Shape
interface. Implement the getArea() method for each of the three classes.
------------------------------------------------------CUT----------------------------------------------------
1) Write a Java program to check whether the given integer is a prime number or not.
2) Write a java program to accept a number from user, If it is greater than 1000 then throw user
defined exception “Number is out of Range” otherwise display the factors of that number.
(Use static keyword)
------------------------------------------------------CUT----------------------------------------------
1) Write a Java Swing program to create a single ball bouncing inside a JPanel.
----------------------------------------------------CUT-------------------------------------------------
1) Write a Java program to simulate traffic signal using multithreading.
2) Write a Java program to accept two integers from user and swap their values using
temporary variable.
----------------------------------------------------CUT-------------------------------------------------
1) Write a Java program to accept string from user and convert it in opposite case. [Lowercase to
uppercase & vice versa].
2) Write a Java program to create an abstract class Vehicle with abstract methods startEngine() and
stopEngine (). Create subclasses Car and Motorcycle that extend the Vehicle class and implement the
respective methods to start and stop the engines for each vehicle type.