wood burning stoves 2.0
The moose likes Beginning Java and the fly likes Java Code Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Code Help" Watch "Java Code Help" New topic

Java Code Help

Jake Wayne

Joined: Feb 16, 2013
Posts: 1
Hey guys, keep going from error to error with this

This is what its complaining about:
Person.java:5: error: cannot find symbol
public static void main(string[]args);
symbol: class string
location: class Person
Person.java:5: error: missing method body, or declare abstract
public static void main(string[]args);
Person.java:8: error: incompatible types
required: int
found: String
Person.java:11: error: cannot find symbol
System.out.printin("Your name is "+name +"and you're "
symbol: method printin(String)
location: variable out of type PrintStream
4 errors
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

caveat:you cant call non-static things from static stuff without new stuff.

*i like your combination of old whitesmith and recent famous allman indent though...
Winston Gutkowski

Joined: Mar 17, 2011
Posts: 8942

Jake Wayne wrote:Hey guys, keep going from error to error with this

1. What is the brace before your println() statement for?
2. What is: 'public static void main(string[]args);'? And before you answer "a main() method declaration", look again, because it isn't (at least not what you think it is).


Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

another hint...

in java, there is a difference between 'a' and 'A', 'b' and B', 'c' and 'C'...all the way up.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Vijay Kalkundri

Joined: Feb 19, 2012
Posts: 6
1) You are declaring name as a int but using it as a string.
2) The braces before the system.out.println are nt required.
3) If you are declaring the variables outside main and using them in main, then you should make the variables as static.
4) string[] args should be String[] args

Hope this will help you compile the code and run the same.

~Vijay k
I agree. Here's the link: http://aspose.com/file-tools
subject: Java Code Help
It's not a secret anymore!