• Post Reply Bookmark Topic Watch Topic
  • New Topic

Started Java today  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just started to learn Java from the web. Absolute newbie. Feel encouraged by "No question too simple or small . . ."
Downloaded JDK and Eclipse and tried the "Hello World" program. The code I type would not come through whereas an identical code copy pasted from the internet works just fine.
I have tried for hours to see the difference between my work and the one I copy paste. Cant see a single difference. The one I typed is

package chapter1.examples;
public class HelloWorld {
//my first comment
        public static void main(String[] args) {
System.out.printIn("Hello World !"):
       }
  }
This is the error I get
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method printIn(String) is undefined for the type PrintStream

at chapter1.examples.HelloWorld.main(HelloWorld.java:6)

Where is the problem? Been at it for nearly couple of hours now.
Thanks for any help
 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

The print statement is println with a small L, not a big I
 
Saloon Keeper
Posts: 3332
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is println(), that's with an 'L' and an 'N'. You've misspelled it.

As you are just starting out it is recommended that you do everything through command line programs and not use any IDE such as Eclipse. Learning to work with an IDE has its own learning curve and will frustrate you when what you really want to do at this point is to concentrate on Java. Also by running everything on the command line you are becoming aware of the Java workflow: editing, compiling, and running. This will give you a better understanding down the road as to what an IDE is doing on your behalf. For a text editor you can use notepad but lots of folks use a program called notepad++.
 
Suneel Pr
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. Could have sworn that was an I and not a 'l'. The reply ended about two hours of misery. Will persist. Thanks for the advice about notepad.
Could be awesome if you could point to some resources for someone about my leve
 
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a start check out:

The Beginners FAQ
The Oracle Java Tutorials
 
Rancher
Posts: 2240
28
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!