This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Wrong code  RSS feed

 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm new in this forum, and I'm a beginner, I just start my first year in university this year.
I want to know whats the wrong with this code please, it doesn't work

 
Knute Snortum
Sheriff
Posts: 4070
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Java is case sensitive. You should write System.out.println.
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Also, Java statements, that are not declarations, must be in an constructor, initializer, or method. You can't just place code anywhere.

Henry
 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:Welcome to the Ranch!

Java is case sensitive. You should write System.out.println.


Thank you Knute Snortum, I'll take it in my consideration in future
 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Also, Java statements, that are not declarations, must be in an constructor, initializer, or method. You can't just place code anywhere.

Henry


Thanks Henry Wong for your replying.
 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is case sensitive. You should write System.out.println.


By the way Knute Snortum the code still not works!
Did you try it.
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thamer Tm wrote:
By the way Knute Snortum the code still not works!
Did you try it.


Can you show us the changes?

And if all you changed was the println(), then did you read my post?

Henry
 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Thamer Tm wrote:
By the way Knute Snortum the code still not works!
Did you try it.


Can you show us the changes?

And if all you changed was the println(), then did you read my post?

Henry


 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, not only did you not fix the problem that I mentioned -- but you also not fix the problem that Knute mentioned either. Don't know what more hints to provide. Sorry if this sounds blunt, but perhaps you can go back and review the books / tutorials that you are using?

Henry
 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:Well, not only did you not fix the problem that I mentioned -- but you also not fix the problem that Knute mentioned either. Don't know what more hints to provide. Sorry if this sounds blunt, but perhaps you can go back and review the books / tutorials that you are using?

Henry


I told you i'm a beginner and i joined here to learn from you and from other guys here
I didn't say i know
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see from your other topic...

http://www.coderanch.com/t/657866/java/java/Beginner-java

that you are looking for book to start. That is a very good idea, as it is very hard to learn from a forum from scratch.

Good luck. And welcome to the ranch.
Henry
 
Knute Snortum
Sheriff
Posts: 4070
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thamer Hamed wrote:
By the way Knute Snortum the code still not works!
Did you try it.

I didn't even notice there was no method! In the beginning, you will write programs that have a main method. You'll quickly learn to get code out of the main method, but for now, let's just say that you need to start your programs like this:


That needs to be in a file called AnyClassName.java.
 
Thamer Hamed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:
Thamer Hamed wrote:
By the way Knute Snortum the code still not works!
Did you try it.

I didn't even notice there was no method! In the beginning, you will write programs that have a main method. You'll quickly learn to get code out of the main method, but for now, let's just say that you need to start your programs like this:


That needs to be in a file called AnyClassName.java.




Thank you Knute Snortum.
I just start to learn java before my term in college start, and i saw this example in a book, so i want to put it in eclipse program
but unfortunately it doesn't work with me, and i didn't know what's the wrong

Thanks again bro, you really helped me
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!