• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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
 
Bartender
Posts: 10969
87
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • 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
 
Rancher
Posts: 5096
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
 
Please do not shoot the fish in this barrel. But you can shoot at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic