Professional Documents
Culture Documents
How Does System - Out
How Does System - Out
Translate:
Search
Home
Java
C/C++
Databases/SQL
PHP
Javascript
Data Structures
Design Pattern Questions
Operating Systems
Recursion
Networking
Excel Interview Questions
HTML5
General/Miscellaneous
Apache Interview Questions
Non-Technical Questions
Interviewing in India
Working As a Software Engineer
Job Advice For Programmers
Financial Analyst Questions
Puzzles
Assortment of Knowledge
American Vocabulary
Technical Vocabulary
Science Questions
popup
About
searchresults
newsletter-signup
Java
Java Interview Questions
How System.out.println() works
JVM platform dependent?
Method overriding vs overloading
Why have a private constructor
Difference between object and class
How copy constructors work
Final modifier
Finally block
Java: Will Finally run after return?
Java Protected Example
Java serializable class example
Multiple Inheritance
How to Create a Thread in Java
Interface vs. Abstract Class
Thread States in Java
Arithmetic Exception
Overridden Method
Dynamic Binding
Can constructors be synchronized in Java?
Does Java pass by reference or by value?
Difference between a primitive type and a class
type?
Does Java have pointers?
Downcasting in Java
Java: Diamond Problem
Java: Can an interface extend another interface?
Java: Are objects of the same type as the interface
implemented?
Java: Can an interface be instantiated?
Find First Nonrepeated Character
Java: Whats the difference between equals() and
==?
Find trailing zeros in factorial
Java Reflection Example
Bit Manipulation Interview Questions and
Answers
XOR in Java
When to use inner classes in Java
Java Inner Class Example
Inner vs nested class
Pluralsight Training
Advanced & Beginner Classes. Free 10 Day Trial. Sign Up
Now!
With that in mind, lets break this down, starting with the dot operator. In Java, the dot
operator can only be used to call methods and variables so we know that out must be
either a method or a variable. Now, how do we categorize out? Well, out could not
possibly be a method because of the fact that there are no parentheses the ( ) after
out, which means that out is clearly not a method that is being invoked. And, out
does not accept any arguments because only methods accept arguments you will never
see something like System.out(2,3).println. This means out must be a variable.
Java Certification
http://www.programmerinterview.com/index.php/java-questions/how-system-out-println-works/
1/4
15/1/2015
System.out.println?
When the JVM is initialized, the method initializeSystemClass() is called that does
exactly what its name says it initializes the System class and sets the out variable.
The initializeSystemClass() method actually calls another method to set the out
variable this method is called setOut().
Email
Country
Inventory Software
United States
Quickbooks Inventory
Management Free - 14 Day
Trial.
Programmer Interview
Jaime 23 468
Previous
Next
8 Comments
Programmer Interview
Sort by Best
Login
Share Favorite
2/4
15/1/2015
8 months ago
I was wondering how the hell can we call a non static println() method without
any instance, thanks for the info about initializeSystemClass().
12
Reply Share
16 days ago
Reply Share
a year ago
Reply Share
hamreen ahmad
5 months ago
Reply Share
MichaelM
2 months ago
The questions from others is a reason why these types of questions seem
irrelevant to me. Maybe when would you use the command or what is it used
for? I wonder how many actual programmers could articulate something like
this versus use it adequately? If you're basing hiring someone on these types
of questions I'd ask if you're hiring a programmer or a professor? lol
1
Reply Share
Youngsam
a month ago
http://www.javainterview.net
Guest
Reply Share
6 months ago
The question is how is System.out connected to println(). Are you saying it's a
variable that calls a method. I think that's the puzzling part.
Reply Share
4 months ago
System class uses static final reference variable 'out' ( public static
final PrintStream out; ) of type PrintStream to invoke the method
'println()' defined in PrintStream class. Actually System class imports
'java.io' package to so that it can invoke the method 'println()'
You can view : System.out.println() explained for better understanding.
Reply Share
WHAT'S THIS?
Overridden Method
Subscribe
http://www.programmerinterview.com/index.php/java-questions/how-system-out-println-works/
Privacy
3/4
15/1/2015
Would you like to thank ProgrammerInterview.com for being a helpful free resource? Then why not tell a friend about us, or
simply add a link to this page from your webpage using the HTML below.
Link to
<a href="http://www.programmerinterview.com/index.php/java-questions/how-system-out-println-works/">Programmer and Software Interview Questions and AnswersHow Does Syst
this
page:
Please bookmark with social media, your votes are noticed and appreciated:
Copyright 2013 | Programmer Job Board | India Job Board for Programmers | About |
http://www.programmerinterview.com/index.php/java-questions/how-system-out-println-works/
4/4