X-Received: by 10.42.86.69 with SMTP id t5mr14667510icl.33.1415372869715; Fri, 07 Nov 2014 07:07:49 -0800 (PST) X-Received: by 10.140.19.193 with SMTP id 59mr23181qgh.19.1415372869680; Fri, 07 Nov 2014 07:07:49 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!r10no5121570igi.0!news-out.google.com!u5ni26qab.1!nntp.google.com!u7no3113482qaz.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.help Date: Fri, 7 Nov 2014 07:07:49 -0800 (PST) In-Reply-To: <29442c5a-69a2-451a-88f0-25a5e0b9937e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.163.40.212; posting-account=TnvAbgoAAADYIyXNE98UkP3edYkcUyln NNTP-Posting-Host: 69.163.40.212 References: <29442c5a-69a2-451a-88f0-25a5e0b9937e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <21b2fb24-2daa-4a8d-8cf3-a77e6f1e1f9b@googlegroups.com> Subject: Re: Compile error: java: expected From: abiolaquadri1987@gmail.com Injection-Date: Fri, 07 Nov 2014 15:07:49 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.help:3085 On Monday, October 14, 2013 6:33:25 AM UTC-7, Marc B wrote: > Hello, > > I am new to Java. I create a reference variable, and then call a final method on that variable but on compilation I get this error: > > java: expected > > pointing to the last line - p.sing(); > > This is my code: > > class MyClass{ > public static void main(String[] args){ > > } > } > > class Person { > final void sing() { > System.out.println("la..la..la.."); > } > } > class Professor { > final void singalong() { > System.out.println("la..la..la.."); > } > Person p = new Person(); > p.sing(); > } > > What does the error mean? What identifier needs to be present on that line p.sing();??? > > Thanks, > > Marc I'm new here and have got some issues to post,but can't just get it posted.How do i do that?