This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes variable declaration in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "variable declaration in java" Watch "variable declaration in java" New topic
Author

variable declaration in java

saravana sankar
Greenhorn

Joined: Oct 21, 2002
Posts: 1
hai everyone,

In java I was surprised by the following coding.

class c1
{
public static void main(String a[])
{
int �;
� = 10;
System.out.println("The value is : " +�);
}
}
I thought that this will give an error but it is getting excecuted normally.
Any variable should start with an alphabet
or underscore or currrency.
But I am surprised to see that
the value between Alt-128 to Alt-158 also comes under this
category.
so pls. give explanation.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
This has nothing to do with Java News so I will move this to... hmmmm....
Java In Genral (Intermediate).


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
An identifier (variable) should start with a letter - including underscore (_) or dollar sign ($) - followed by letters or digits.
A "letter" uses the unicode definition, which includes lots of characters from many languages.
See javadoc for Character.isJavaIdentifierStart()
or the JLS section about identifiers
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: variable declaration in java
 
Similar Threads
help required in Java program
suggestions required for Java program
help and suggestions required in Java program
variable names
want to disable ALT+TAB key using java