0% found this document useful (0 votes)
58 views

Java 10printouts Slip-1

This document contains 10 questions asking to write Java programs that: 1) read characters from a file and modify case or display category, 2) accept city names and display in descending order, 3) display file contents in reverse order, 4) validate an employee name and throw a custom exception, 5) change frame color when closing to remain visible, 6) calculate area and volume of cone and cylinder using an abstract Shape class, 7) display number of characters, lines, and words in a file, 8) throw a custom exception if a number is 0 or calculate digit sum, 9) accept and display employee details on a new AWT frame, and 10) calculate area of circle and sphere using a final Shape interface.

Uploaded by

Ajinkya Bhagat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Java 10printouts Slip-1

This document contains 10 questions asking to write Java programs that: 1) read characters from a file and modify case or display category, 2) accept city names and display in descending order, 3) display file contents in reverse order, 4) validate an employee name and throw a custom exception, 5) change frame color when closing to remain visible, 6) calculate area and volume of cone and cylinder using an abstract Shape class, 7) display number of characters, lines, and words in a file, 8) throw a custom exception if a number is 0 or calculate digit sum, 9) accept and display employee details on a new AWT frame, and 10) calculate area of circle and sphere using a final Shape interface.

Uploaded by

Ajinkya Bhagat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Q1.

Write a java program to read the characters from a file, if a character is


alphabet then reverse its case, if not then display its category on the Screen.
(whether it is Digit or Space)

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).

Q9. Write a Java Program to accept the details of Employee(Eno, EName,Sal)


from the user and display it on the next Frame. (Use AWT)

Q10. Define an Interface Shape with abstract method area(). Write a java program
to calculate an area of Circle and Sphere.(use final keyword)

You might also like