Do Java implementations exist without System.out? Is it possible?
Do Java implementations exist without System.out? Is it possible?
So I'm pretty new to Java and this may be a question conceived due to some misconceptions, but I'm just curious: Do all "forms" (I guess different JREs? Or VMs?), for example, I've heard of Dalvik, of Java include an automatically imported System.out? What makes them different from the standard one i downloaded from Oracle to learn with? Inform me if I'm not understanding any concepts correctly, please.
Maybe ask yourself - what is System.out?
– Scary Wombat
2 days ago
@Hovercraft Full of Eels The syntax? Also, couldn't it just exclude System.out and leave other things in? Like I heard in Android System.out.println isnt used, so why not exclude it?
– Haw Exp
2 days ago
The syntax is Java, defines the Java language
– Hovercraft Full Of Eels
2 days ago
It is possible to have a no-op stream. e.g.
java > /dev/null
– killjoy
2 days ago
java > /dev/null
1 Answer
1
In addition to the Java language specification which, in section 7.3, says that
Every compilation unit implicitly imports every public type name declared in the predefined package java.lang
, as if the declaration import java.lang.*;
appeared at the beginning of each compilation unit immediately after any package declaration. As a result, the names of all those types are available as simple names in every compilation unit.
java.lang
import java.lang.*;
there is also a Java Compatibility Kit which any conforming implementation of Java must pass. Thus, anything which wants to call itself "Java" must include all the parts of Java, including System.out
.
System.out
.... which is a good thing, because if a JVM implementor was allowed to tinker with the Java APIs, then portability goes out of the window (tied to a brick!).
– Stephen C
2 days ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
If it doesn't contain standard Java library classes, how can it be called "Java"?
– Hovercraft Full Of Eels
2 days ago