Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.help Subject: Re: compiler error expected. Date: Wed, 2 Sep 2015 08:29:29 -0400 Organization: A noiseless patient Spider Lines: 59 Message-ID: References: <2e7b7127-78fb-4acb-a31d-0229544de3f7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 2 Sep 2015 12:27:45 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="858a9d65d95f4ea4d355bd116aa2cdbf"; logging-data="19054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VEqN8eqoiFXxApCxbHCVI" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <2e7b7127-78fb-4acb-a31d-0229544de3f7@googlegroups.com> Cancel-Lock: sha1:fgqZXDyNYx0I7WhIGSx/uxpq62A= Xref: csiph.com comp.lang.java.help:3561 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: 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