Question: Consider the following program, and the resulting error messages that occur when the program gets compiled using the javac command. In 1 or 2 simple
Consider the following program, and the resulting error messages that occur
when the program gets compiled using the javac command. In or simple
English sentences, explain why the error messages occurred:
This program does not compile. How come?
class BadExample
public static void main String args
int x ;
int y ;
computeSum;
static void computeSum
int sum x y;
System.out.printlnsum sum;
Here is what was output after we attempted to compile this program:
BadExample.java:: error: cannot find symbol
int sum x y;
symbol: variable x
location: class BadExample
BadExample.java:: error: cannot find symbol
int sum x y;
symbol: variable y
location: class BadExample
errors
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
