Professional Documents
Culture Documents
Thread
Thread
Thread
import java.io.FileNotFoundException;
import java.io.IOException;
class Parent{
public void helloEveryone() throws IOException{
System.out.println("Hello parent..");
}
}
try {
//define two numbers
int num1 = 100, num2 = 0;
int result = num1 / num2; // divide by zero
//print the result
System.out.println("Result = " + result);
}
catch (ArithmeticException e) {
System.out.println("ArithmeticException:Division by Zero");
}
}
-------------
import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter two integer numbers");
-------------------------
public static void main(String[] args) {
ArrayExample arrExample = new ArrayExample();
Integer[] arr = arrExample.createRandom();