+ 1
An error keeps coming like ; needed in public static void.someone help
import java.util.Scanner; public class IfElse { public static void main (String args []) Scanner input = new Scanner(System.in); { System.out.println ("enter any number"); { int x; x = input.nextInt(); if (x==2) {System.out.println ("no");} else {System.out.println("there you go");} } } }
2 Respostas
+ 5
"{" from row 6 should be right after main from row 4
0
public static void main (String args [])
{ //added bracket
Scanner input = new Scanner(System.in);
//{