[Solved] Java Expect “{” error dont understand


Remove .java in source code. change below line

 public class Bister.java {

like this

 public class Bister {

Your code will be like

import java.util.Scanner;

public class Bister {

public static void main(String[] args) {
Scanner in = new Scanner(System.in);

System.out.print("Input first number: "); 
 int num1 = in.nextInt();

System.out.print("Input second number: "); 
int num2 = in.nextInt();

System.out.println(num1 + " x " + num2 + " = " + num1 * num2); }

}

7

solved Java Expect “{” error dont understand