Question: Can you please help me to solve this java program Create an Eclipse Project called javaProgram. Create a class called CheckedVUncheckedExceptions. In this class create

Can you please help me to solve this java program

Can you please help me to solve this java program Create an

Create an Eclipse Project called javaProgram. Create a class called CheckedVUncheckedExceptions. In this class create two methods. Create a static method called capitalizeString(String s) to convert a String that's passed to ALL CAPS. The capitalizeString method must be declared to throw a NullPointerException. Create a second static method called openFile(String fileName) which will accept the name of a file and attempt to test whether the file exists [File file = new File(fileName); use file.exists ( to test file existence]. The openFile method must be declared to throw IOException. Now call both methods from the main method (note: you will be forced by the compiler to place a try and catch around one the methods you have written due to it being a checked exception). Required activities and marking guideline: - Implement capitalizeString method - Declare capitalizeString method to throw NullPointerException - Implement openFile method - Declare openFile method to throw IOException - Call both methods from the main - Add necessary try catch to method calls in main - Add comments to your code explain why one of the methods called in the main required a try block (or throw) and the other method did not (use regular Java comments in the code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!