aspose file tools*
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
Author

Java Code Help

Jake Wayne
Greenhorn

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
name="Petey";
^
required: int
found: String
Person.java:11: error: cannot find symbol
System.out.printin("Your name is "+name +"and you're "
+age);
^
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
Bartender

Joined: Mar 17, 2011
Posts: 7801
    
  21

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).

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11314
    
  16

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
Greenhorn

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