How do I remove the error from the code? public class MidtermProblems { public class Main { public static void main( String args[] ) { public static String difference(a, b) Scanner input = new Scanner(System.in); int a; int b; int userNum; System.out.print( "Input first integer: " ); a = input.nextInt(); System.out.print( "Input second integer: " ); b = input.nextInt(); if ( a == b ) System.out.printf( "EQUAL\n"); if ( a-b > 0 ) System.out.printf( "a is bigger by " +(a-b=userNum)); if ( a-b < 0 ) System.out.printf( "b is bigger by "+ (b-a=userNum)); } public static void main(String[] args) { System.out.println(MidtermProblems.difference(userNum)); } }
How do I remove the error from the code?
public class MidtermProblems {
public class Main {
public static void main( String args[] )
{
public static String difference(a, b)
Scanner input = new Scanner(System.in);
int a;
int b;
int userNum;
System.out.print( "Input first integer: " );
a = input.nextInt();
System.out.print( "Input second integer: " );
b = input.nextInt();
if ( a == b )
System.out.printf( "EQUAL\n");
if ( a-b > 0 )
System.out.printf( "a is bigger by " +(a-b=userNum));
if ( a-b < 0 )
System.out.printf( "b is bigger by "+ (b-a=userNum));
}
public static void main(String[] args) {
System.out.println(MidtermProblems.difference(userNum));
}
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images