Results 1 to 11 of 11
- 09-03-2008, 07:34 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
[SOLVED] Can't figure out what's wrong
I am new to Java and I am doing a simple test program to display my first and last name. I need three methods: Main(), Name(), and Display(). I get this error when I compile:
ShowName.java:16: cannot find symbol
symbol : method Name()
location: class ShowName
Name();
This is my code:
public class ShowName
{
public static void main(String[] args)
{
//data definition
String firstName;
String lastName;
}
//methods
{
Name();
{
firstName = "Vanessa";
lastName = "Roach";
Display();
{
System.out.println("My name is" + firstName + lastName + "!");
System.exit(0);
}
}
}
I would really appreciate any help I can get on this
- 09-03-2008, 08:06 PM #2
You have a ; following the method name that makes it look like a call to that method rather than a definition of it.
Also is there an extra { before Name()?
It's hard to read your code without formatting.
Please use the [ CODE ] tags around your code to preserve formatting.
- 09-03-2008, 08:21 PM #3
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
Thank you for the reply
- 09-04-2008, 09:09 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
If you have solve the problem please mark the thread as solved. It's help to avoid confusion on other members.
- 09-04-2008, 09:13 AM #5
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
Can't you do that? As a moderator?
I die a little on the inside...
Every time I get shot.
- 09-04-2008, 09:15 AM #6
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Maybe (s)he could, but it still wouldn't be his/her job to tell the OP that (s)he must be satisfied with some answer already given. It is up to the OP to decide when the problem is solved.
- 09-04-2008, 09:20 AM #7
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
She looks like a woman to me, if it's her on the pic there. ;)
I die a little on the inside...
Every time I get shot.
- 09-04-2008, 03:15 PM #8
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
I will try to remember that Eranga. Was first time in forum and didn't realize.
- 09-05-2008, 06:52 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 09-05-2008, 06:54 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 09-05-2008, 07:09 AM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
[SOLVED] Can't figure out my thread/awt problem
By Zosden in forum Advanced JavaReplies: 7Last Post: 07-29-2008, 05:13 PM -
Please Help, can't figure out what I'm doing wrong.
By tamik0 in forum New To JavaReplies: 2Last Post: 07-11-2008, 09:41 AM -
How can I figure out all the IPs on my network devices
By coco in forum NetworkingReplies: 3Last Post: 12-25-2007, 04:10 AM -
Seems so simple yet I can't figure it out!
By adamhaviland in forum New To JavaReplies: 1Last Post: 11-03-2007, 06:26 PM -
I can't figure this out
By silvia in forum New To JavaReplies: 3Last Post: 07-20-2007, 04:38 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks