Solved

println

Posted on 2012-03-14
8
332 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
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle 11g 23 73
factorial example 4 39
servlet example 11 40
Move windows 10 users 8 49
If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now