Java 10printouts Slip-1
Java 10printouts Slip-1
Q2. Write a java program to accept n names of cites from user and display them in
descending order.
Q3. Write a java program to display the contents of a file in reverse order.
Q4. Write a java program to accept Employee name from the user and check
whether it is valid or not. If it is not valid then throw user defined Exception
“Name is Invalid” otherwise display it.
Q5. Write a Java program which will create a frame if we try to close it, it should
change it’s color and it remains visible on the screen(Use swing).
Q6. Define an abstract class Shape with abstract methods area() and volume().
Write a java program to calculate area and volume of Cone and Cylinder.
Q7. Write a java program that displays the number of characters, lines & words
from a file.
Q8. Write a java program to accept a number from the user, if number is zero then
throw user defined Exception “Number is 0” otherwise calculate the sum of first
and last digit of a given number (Use static keyword).
Q10. Define an Interface Shape with abstract method area(). Write a java program
to calculate an area of Circle and Sphere.(use final keyword)