Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Started Java today

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9418
79
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a start check out:

The Beginners FAQ
The Oracle Java Tutorials
 
Master Rancher
Posts: 4819
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://docs.oracle.com/javase/8/docs/api/index.html
reply
    Bookmark Topic Watch Topic
  • New Topic