-
April 17th, 2008, 07:05 AM #1Junior Member
- Join Date
- Apr 2008
- Location
- New York
- Posts
- 11
asking for identifier reuired in java
Hi..
I am new to java and need a help on this part
I am declaring a variable as below and it is showing error.. as identifier required.. help me out to understand the reason behind the same..
class abc
{
int a;
a=10; // on this point it is asking for identifier reuired
public static void main(String[] args)
System.out.println(a);
}
as i have already declared int a, why cant i assign a=10 in the next statement
Response ASAP .... appreciated..
Thanks in advance
Sorry if i have posted it in wrong category but the thg is i need a immediate help and am quit weired out
-
April 21st, 2008, 05:09 AM #2Junior Member
- Join Date
- Apr 2008
- Posts
- 23
Your Question is that
class abc
{
int a;
a=10; // on this point it is asking for identifier reuired
public static void main(String[] args)
System.out.println(a);
}
here a is Instance Level varible so, you cannot access without any object.
Define a object and write
suppose you have Object obj
obj.a;
-
April 21st, 2008, 05:22 AM #3Junior Member
- Join Date
- Apr 2008
- Location
- New York
- Posts
- 11
-
April 21st, 2008, 01:19 PM #4
-
April 28th, 2008, 06:44 AM #5Junior Member
- Join Date
- Apr 2008
- Location
- New York
- Posts
- 11
Hi.. Friends...
Thanks for all you reply's and feedback...
I got the issue and the concept i was lancing to take on with...
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Computer Unique Identifier.
By exally in forum Webmastering and ProgrammingReplies: 8Last Post: October 18th, 2011, 07:04 AM -
Launching Java webpages with different Java settings?
By LostBok in forum Webmastering and ProgrammingReplies: 1Last Post: December 11th, 2006, 03:38 AM -
Switching Off P4 Identifier?
By ClubMed in forum Processors, Memory, and OverclockingReplies: 6Last Post: November 25th, 2002, 01:46 PM



LinkBack URL
About LinkBacks



Reply With Quote

Prime Minister David Cameron said Britain would be "absolutely resolute" in the face of terrorism Thursday, as he vowed to track down those behind the brutal hacking death of a British soldier in...
Britain would be "absolutely...