Jump to content

unclosed string literal

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Tank314

Tank314

    Newbie

  • Members
  • PipPip
  • 10 posts
Code
public class Ex22{
        public static void main (String[] args){
            System.out.print("\"To be or not to be
            \n
            that's the question\"");
        }
    }
Errors
Posted Image

What's wrong?

Attached Files



#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Means you started a String with " but didn't close it. Your code should be:

        public static void main (String[] args){

            System.out.print("\"To be or not to be " +

            "\n" +

            "that's the question\"");

        }






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users