• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is wrong with these two codes?

 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



i cant even seem to understand the errors...first one is illegal line end and second is unclosed literal? what does these mean?
 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you explain this to me in simple language
 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The unicode '\u000A' converted into new line character before class AQuestion1 get compiled, it will show to compile something like


try the following code:


Hope its clear to you, let me know if you need further clarification?
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you mean everything after \ is being omitted? there is something in the jls about \ being followed by u.....am not clear still
 
Neha Daga
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because this unicode literal represents new line '\n' and java forbids using it.
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
understood now.....

\u000a means \n...newline

 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and \u are evealuted before the class compiles
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is the correct usage....
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then you don't have the char
 
Neha Daga
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It compiles and run successfully on my computer but with no output.

you can also read this
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There IS output. The char. But the char is a enter so I guess you mist it.
 
Neha Daga
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could not understand, what you trying to say.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oke try this:



When you run it, you can see that a new line is printed. That is the char.
 
Neha Daga
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it...so yes we dont have '\012' character as it is octal version of enter.

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic