What is "A"? You are trying to create an object of type "A", but from the code you have posted, no such class exists...
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
Is there a problem with that second example?
It looks unrelated to your original post, what exactly do you need me to help you with?
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
i got this code, unfortunately it refuses to run.. please help..
Something is wrong with "A", dnt know what it is...
im not really good in making classes.. some gave this to me but i don't fully understand...
this is the code i guess...
Now how are we supposed to help you on this information given by you ???
If you are not good at creating classes, I recommend you purchase a good book like "Head First Java" or something similar which till teach you object oriented programming along with Java.
Also the "Starting Java" thread at the top as the name suggests has been created specifically for users like yourself who are just begining to do programming.
Also asking questions like the one above and asking us to fix it will only make you more dependent on others to get your work done and if you intend making a career in this field, I am pretty sure you do not want that.
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
propably the wrong part is that you do not have a class A, so you're trying to instantiate and use an object type that doesn't exist.
create the class and try it again
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
the second problem seems to be ok by me
to run the code simply use
javac TestGreeting.java
then
java TestGreeting
it should run with out any problem
a more than obvious and useless answer: since the thread-starter had errors while running the code, it is safe to assume he/she has already figured out how to run a java app.
was it really necessary to post this twice?
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
then he would have gotten the obvious can not find main method error
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
Chill Out Guys, the original poster has not posted since 4 days already
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154