• Post Reply Bookmark Topic Watch Topic
  • New Topic

illegal identifiers...  RSS feed

 
Vishal Kurkure
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int D'oh;why java compiler is giving error?Is it not according to the rules of identifier?
The errors are:
1. error: unclosed character literal
2. error: <identifier> expected
 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answered here link
 
Vishal Kurkure
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ganish,but here D is a letter and after that we can have any charcter so why it is wrong?
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Kurkure wrote:after that we can have any charcter


Where did you get that idea?
 
Vishal Kurkure
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In kathy sierra book i read that identifier should start with letter or connecting char and then and combination of letter or digit or connecting char.
I want to know the proper reason why that error is coming

 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Kurkure wrote:In kathy sierra book i read that identifier should start with letter or connecting char and then and combination of letter or digit or connecting char.


That bolded part is a lot different than "any character", don't you think? So go back and look at your proposed "identifier" and see whether all of its characters are letters or digits or connecting characters.

Perhaps you aren't quite sure what a "connecting character" is? I don't have the book at hand but I wouldn't be surprised if it went on to explain that too. No?
 
Vishal Kurkure
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul Clapham.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!