Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: error Identifier expected?

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default error Identifier expected?

    Hi

    Some 10 years ago I used to write Java programs effieciently, then stopped due to some circumstances.
    Now trying to recap java again.

    My PC has Win 7 (32 bit) with JDK 1.7.0_03 installed and have also put the path of "bin" folder in the PATH variable, other wise javac was not working.

    Anyways, I wrote a simple code to test and it gave me some error which I could not understand WHY?
    Please advice as it gives me "error <identifier> expected at line 9

    1. public class tst2 {
    2. public static void main(String[] args) {
    3. System.out.println("HI");
    4. }
    5.
    6.
    7. public class tstinner {
    8. int a1, b1;
    9. a1 = b1 = 6;
    10. }
    11.
    12.}

    I have put the type "int" and then initialise the var a1 & b1 in a single line which is valid I guess, then why is it giving me the error?
    thanks


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: error Identifier expected?

    Asked and answered at java-forums.org

  3. The Following User Says Thank You to pbrockway2 For This Useful Post:

    copeg (August 14th, 2012)

  4. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: error Identifier expected?

    Quote Originally Posted by pbrockway2 View Post
    Asked and answered at java-forums.org
    Thanks for the help...

Similar Threads

  1. '{' expected error please help
    By erdy_rezki in forum What's Wrong With My Code?
    Replies: 8
    Last Post: April 9th, 2012, 10:01 AM
  2. ok i have tried everything but identifier expected keeps popping up!
    By knoxy5467 in forum What's Wrong With My Code?
    Replies: 16
    Last Post: June 5th, 2011, 11:13 PM
  3. Identifier expected
    By Sphinx in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 30th, 2010, 02:50 PM
  4. <identifier> expected
    By Trunk Monkeey in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 21st, 2010, 09:33 PM
  5. [SOLVED] Java error "Another <identifier> expected"
    By bruint in forum What's Wrong With My Code?
    Replies: 23
    Last Post: May 1st, 2009, 08:47 AM