evisit chapter 5 example, but this time, no method can throw any exception out of the method and if an exception was detected then you will have to throw your own custom exception to let the user know what happened.
Let's revisit chapter 5 example, but this time, no method can throw any exception out of the method and if an exception was detected then you will have to throw your own custom exception to let the user know what happened.
public class Chapter11Demo{
public static void main(java.lang.String[] args) {method1();}
private static void method1(){ method2();}
private static void method2(){ method3();}
private static void method3(){ method4();}
private static void method4(){ method5();}
private static void method5(){ method6();}
private static void method6(){
java.io.File in=new java.io.File("somefile.txt");
java.io.File out=new java.io.File("somefile2.txt");
java.util.Scanner inFile=new java.util.Scanner(in);
java.io.FileWriter outFile=new java.io.FileWriter(out);
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps