Question: What will be the output of the following Java code? class Output { public static void main(String args[]) { int x=y=z=20; } } a) compile

What will be the output of the following Java code?

  1. class Output 
  2. {
  3.         public static void main(String args[]) 
  4.         {    
  5.              int x=y=z=20;
  6.  
  7.         } 
  8. }

a) compile and runs fine
b) 20
c) run time error
d) compile time error

Step by Step Solution

3.52 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Option D compile time error ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!