Develop
a Java program using an enumeration called Department containing CSE, ISE, ECE,
and MECH. Accept a department name as input and display the selected department
using valueOf().
Procedure:
1. Open Eclipse IDE.
2. Create a New Java Project.
3. Uncheck Create module-info.java
file and click Finish.
4. Right-click the src folder → New →
Class.
5. Enter Class Name: DepartmentDemo.
6. Check public static void
main(String[] args) and click Finish.
7. Replace the generated code with the
program below.
8. Save (Ctrl + S) and Run (Ctrl +
F11).
9. Enter the department name in
UPPERCASE (CSE, ISE, ECE, or MECH).
No comments:
Post a Comment