?
Solved

println

Posted on 2012-03-14
8
Medium Priority
?
337 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 2000 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

801 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