• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

strange doubt challenging

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I remember I came across a character even if present in the comment will not let the program compile.
i mean
void doi()
{
//some character here(inside comment)
}

I am sure there is one character But I dont know what.
If I get to know, I will post in my blogs as the most strange question

any help
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some time ago when I copy pasted a code from internet, my JDk 1.6 raise an warning , the character are non ASCII and commented !!

I don't know whether its Netbeans IDE problem or JDK, I simply remove them and not pursue it further ..

This links discussed what you say !
 
Praveen Seluka
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Thanks for the reply
I came across a valid ascii character I believe
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you believe its a ASCII character only , then better way you check each and every character from 0 to 127.

here is the table.
 
Marshal
Posts: 80865
505
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
More of a beginner's question.

Java is Unicode compliant; you ought not to have any problems with any sort of characters. Please always post the actual code so we can see what it is. You might in fact have a completely different compiler error.

What sort of comment is it? Does it start with /*? If so, any */ anywhere in the comment will convert the rest of the comment to what the compiler sees as nonsense.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats a classic - Unicode is translated as the source is read. A unicode linefeed will cause the // comment to be split, probably producing a following line of illegal code and a compiler error.

Bill
 
Campbell Ritchie
Marshal
Posts: 80865
505
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, of course, a line end character after a // would behave rather similarly to a */
And it might even have different effects on different operating systems, if you are really unlucky!
 
reply
    Bookmark Topic Watch Topic
  • New Topic