Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #3561

Re: compiler error <identifier> expected.

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.help
Subject Re: compiler error <identifier> expected.
Date 2015-09-02 08:29 -0400
Organization A noiseless patient Spider
Message-ID <ms6q00$ije$1@dont-email.me> (permalink)
References <2e7b7127-78fb-4acb-a31d-0229544de3f7@googlegroups.com>

Show all headers | View raw


On 9/2/2015 5:32 AM, tejanaidu.b@gmail.com wrote:
> Hi Team,
>
>      I'm new to Java when I write a program for class and objects, when I try to compile the program getting an error message saying  "error: <identifier> expected"
>
>
> Here is the program.
>
> class Card
> {
> 	int icount;
> 	Static int tcount;

     "Static"?  Did you mean "static"?  They are not the same.

> 		void swipe()
> 	{
> 		icount++;
> 		tcount++;
> 	}
> }
>
> class Demo9
> {
> 	public static void main(Static ar[])

     "Static"?  Did you mean "String"?

> 	{
>
> 		Card v= new Card();
> 		Card b= new Card();
> 		v.swipe();
> 		b.swipe();
> 		b.swipe();
> 		v.swipe();
> 		v.swipe();
> 		int total= Card.tcount;
> 		int Vikas= v.icount;
> 		int banu= b.icount;
>
> 	System.out.println("Total students" + total);
> 	System.out.println("Vikas students" + vikas);

     "vikas"?  Did you mean "Vikas"?  (Or perhaps the earlier
appearance should have been "vikas"  instead of "Vikas"?)

> 	System.out.println("Banu students" + banu);
> 	}
> }
>
> Truly appreciate your response.

     Letter case matters in Java source code: "class" and "Class"
are different, "hashcode" and "hashCode" are different, ...

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar


Thread

compiler error <identifier> expected. tejanaidu.b@gmail.com - 2015-09-02 02:32 -0700
  Re: compiler error <identifier> expected. Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2015-09-02 14:18 +0300
  Re: compiler error <identifier> expected. Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-09-02 08:29 -0400

csiph-web