Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2007, 10:08 AM
Member
 
Join Date: Aug 2007
Posts: 15
one198 is on a distinguished road
Dear Friends

I wrote below coding for a learn the java.I wanna call play method inside the Sing method.but i got error message.How i do this.
Code:
public class Student{ public void Play(){ System.out.println("Child is playing"); } public void Sing(){ play(); System.out.println("Child is singing"); } } public class Test40 { public static void main(String[] args) { Student St1=new Student(); St1.Sing(); } }
Error message is

Test40.java7:cannot find symbol
symbol :method play()
location:class Student
play();


pls help me
Thank you

Last edited by one198 : 10-12-2007 at 01:37 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-12-2007, 06:25 PM
Member
 
Join Date: Aug 2007
Posts: 30
dmacvittie is on a distinguished road
Hey One198,

You're nearly there! Java is case sensitive, so just change "p" in the call to "Play" to be "P".

Note that it is Java convention (though not required by the compiler) to only capitalize the first letter of class and interface names - so "Play" should be "play", and "Sing" should be "sing". But as I say, this is only convention and it should work fine without doing that as long as you use the same capitalization throughout.

Don.
__________________
Don MacVittie F5 Networks -
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-13-2007, 06:07 AM
Member
 
Join Date: Aug 2007
Posts: 15
one198 is on a distinguished road
Hi

Thank you dmacvittie.Now it's works properly.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding an FTP server in java Zucheto Networking 3 06-22-2008 05:24 AM
Help On Coding problem mandrake446 New To Java 3 12-08-2007 08:01 AM
Cannot solve the coding problem of my assignment elimmom New To Java 3 08-13-2007 12:33 PM
Problem in my coding one198 New To Java 9 08-09-2007 11:07 AM
Help with program coding cachi AWT / Swing 1 07-31-2007 08:16 AM


All times are GMT +3. The time now is 06:30 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org