Java OCA OCP Practice Question 726

Question

Which of the following are valid declarations:

Select 3 options

  • A. int a = b = c = 100;
  • B. int a, b, c; a = b = c = 100;
  • C. int a, b, c= 100;
  • D. int a= 100, b, c;
  • E. int a= 100 = b = c;


Correct Options are  : B C D

Note

Java does not allow chained initialization in declaration so option 1 and 5 are not valid.




PreviousNext

Related