output - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

output

vstarvstar Posts: 8Member
Can someone explain why the answer to the following M/C question is, "The code will not compile"?

if (x > 5 )
if ( y < 10 )
System.out.print(

Comments

  • HackmanCHackmanC Posts: 441Member
    Hi,

    Each paragraph of code is a block of code, but you should tell the java compiler which blocks of code should be maintained united, and that should by accomplished with {}

    What you are telling the compiler is this, (if you had properly indented):

    [code]if (x > 5 ) {
    if (y < 10) {
    System.out.print(
  • vstarvstar Posts: 8Member
    Thank you very much. The more I looked at it I thought it was a synrax error.
  • vstarvstar Posts: 8Member
    Thank you very much. The more I looked at it I thought it was a synrax error.
  • vstarvstar Posts: 8Member
    Thank you very much. The more I looked at it I thought it was a synrax error.
Sign In or Register to comment.