• Post Reply Bookmark Topic Watch Topic
  • New Topic

string literal is not properly closed by double quote  RSS feed

 
joka badi
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!..am working with java project which is kind of charting room..but the problem is when am writing the query for listing the message in the conversation the error prevail in my eclipse...string literal is not properly closed by double quote...this is my java file

can anybody help me.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compiler should tell you exactly which line it doesn't like. It should even show you the exact spot where things go awry.

My guess is that it tells you line 11 is no good. In java, you can't break a string across lines like that. It would have to be (at minimum):



Although there is probably a better way.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If you want a newline in the string literal, use "\n". You can't actually use a real newline in the string literal.

Henry
 
joka badi
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exactly the problem is in line 11...so can you tell me what to do please?!
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
joka badi wrote:exactly the problem is in line 11...so can you tell me what to do please?!


Did you read the rest of Fred's post? He gave an example on how to do it.

Henry
 
joka badi
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks..error has gone off.
 
joka badi
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry its seems my code are not working,means it doesn't do what have intended/plan it to do....i want to list conversation in charting room but also have 3 table which is registration,conversation and conversation_reply....can you help me what to do.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
joka badi wrote:sorry its seems my code are not working,means it doesn't do what have intended/plan it to do....i want to list conversation in charting room but also have 3 table which is registration,conversation and conversation_reply....can you help me what to do.

Nobody can help you unless you:

post your current code
tell us what it DOES
tell us what you intended it to do
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!