Develop a Java program to read the marks of three subjects as strings, convert them into wrapper objects, calculate the total and average using autoboxing/unboxing and display the result.
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:
WrapperDemo.
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).
No comments:
Post a Comment