aspose file tools*
The moose likes Beginning Java and the fly likes strange doubt challenging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "strange doubt challenging" Watch "strange doubt challenging" New topic
Author

strange doubt challenging

Praveen Seluka
Ranch Hand

Joined: Jul 17, 2007
Posts: 95
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
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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 !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Praveen Seluka
Ranch Hand

Joined: Jul 17, 2007
Posts: 95
Hi

Thanks for the reply
I came across a valid ascii character I believe
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38340
    
  23
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.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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
Sheriff

Joined: Oct 13, 2005
Posts: 38340
    
  23
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: strange doubt challenging