import java.util.*;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
// Your code here!
/*int a =0/0;
System.out.println("XXXXXXXX");*/
String str="simizu";//If you set this to null, an exception will occur, but since it is an unchecked exception, you do not have to try it.
int i = str.length();
System.out.println(str + "Is" + i + "letter");
//throw new StackOverflowError("StackOverflowError");Memory overflow You can't catch it here, you can't catch it if the server goes down in the first place
throw new IOException("IOException"); //Check exception: Try is required. It's okay because it's thrown next to the method, but if it's not thrown by the method, try catch is required.
}
}
}
Reference material
https://freelance-jak.com/technology/java/1157/
Recommended Posts