Solved

println

Posted on 2012-03-14
8
333 Views
Last Modified: 2013-11-24
IN java , can i use just println and remove the system.out

println("Hello, World"); //i want this

is there an imports namespace or something.
0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
8 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 37722749
no you cannot - you need to have System.out.println("hello");
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37722752
And you do not need any imports for that
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37722756
But System should be upper case
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 47

Expert Comment

by:for_yan
ID: 37722759
this is class System
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/System.html

it is part of java.lang. which will be imported by default

as this is name of the class it should be upper case and Java is case sensistive
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37722763
out is a static varibale of class System so you just append it after dot to the class name without any instance System.out

http://docs.oracle.com/javase/1.5.0/docs/api/java/io/PrintStream.html
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37722765
And out belongs to class PrintStream and then you use method println()
of that class to print
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37722768
if you just leave it
println(..)
it will look fro the method println(..) of the same class which you are creating and if you did not define such method it will complain that there is no such m,ethod in your class
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37722808
If you

import static java.lang.System.out;

Open in new window


you can do

out.println

Open in new window


but i wouldn't. Just write your own method called println if you want to call it
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question