java difference StdOut vs System.out.println [closed]
Asked Answered
A

1

6

I have just started working on java, As i downloaded the eclipse and created a java project. Project was working fine, then i imported a class but it's not working due to following lines

StdOut.println(p + "  " + q);

after searching i have replaced it with

System.out.println(p + "  " + q);

and same way for input.

I tried importing system.io.* didn't worked. then i tried import StdIn not worked

As i can feel is that it may be due to different project template/type. and tutorials links will also be helpful. Thanks

Amphisbaena answered 12/8, 2012 at 18:37 Comment(1)
Most likely, you are enrolled in a course which is attempting to simplify the course without delving into the complexities of the Java programming language. You can download the individual classes here: introcs.cs.princeton.edu/java/stdlibPerry
M
15

StdOut is not a class that comes in the JDK.

Though, StdOut is commonly used in school projects.

Marilumarilyn answered 12/8, 2012 at 18:39 Comment(9)
I also had added the jar file for the said stdout class in my project,Amphisbaena
@HaseebAsif: What IDE are you using? Eclipse?Marilumarilyn
I am using eclipse juno for java developers i can see the added jar file under referenced librariesAmphisbaena
@HaseebAsif: Try reading this link.Marilumarilyn
Already accomplished this thing but yet no luck :-(Amphisbaena
It did worked for me when i added the jar file specifically for this project. Before this i was trying to add for all project by going windows -- preferences -- java and adding class variables thereAmphisbaena
@HaseebAsif: If you want to include the jar for ALL projects, goto Window -> Preferences -> Java -> Installed JREs. Find your default JRE and click edit to add the JARs you want.Marilumarilyn
@HaseebAsif: Actually you should probably do it this way.Marilumarilyn
let us continue this discussion in chatAmphisbaena

© 2022 - 2024 — McMap. All rights reserved.