Question: What will be the result of compiling and running the following program? Select the one correct answer. (a) The program will fail to compile, since
What will be the result of compiling and running the following program?
![public class Assignment { public static void main(String[] args) { int a,](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/3/7/41365bdcc457802f1706937410924.jpg)
Select the one correct answer.
(a) The program will fail to compile, since the compiler will report that the variable c in the multiple assignment statement a = b = c = 20; has not been initialized.
(b) The program will fail to compile, because the multiple assignment statement a = b = c = 20; is illegal.
(c) The code will compile, and print 10 at runtime.
(d) The code will compile, and print 20 at runtime.
public class Assignment { public static void main(String[] args) { int a, b, C; } b = 10; a = b = c = 20; System.out.println (a);
Step by Step Solution
3.50 Rating (160 Votes )
There are 3 Steps involved in it
d An assignment statement is an expression statement The value of the expression s... View full answer
Get step-by-step solutions from verified subject matter experts
