Re: Command-line arg



Wayne <nospam@xxxxxxxxxxxxxx> writes:
Technical specifications could be more precise and either use a specific import declaration or »java.lang.String«:

Joshua Cranmer wrote:
The JLS mentions this in §1.2 Notation:

So not only is Wayne right, but Sun agreed and made sure that the technical specification was precise, even before Wayne suggested that they do so. How very proactive of them.

Throughout this book we refer to classes and interfaces drawn from the Java and Java 2 platforms. Whenever we refer to a class or interface which is not defined in an example in this book using a single identifier N, the intended reference is to the class or interface named N in the package java.lang. We use the canonical name (§6.7) for classes or interfaces from packages other than java.lang.

Thus the class `String' implicitly refers to `java.lang.String'

This might be a mere coincidence, but in Java code one need never explicitly import java.lang either.

--
Lew
.



Relevant Pages

  • Re: Looking for Java metrics article and tool
    ... The article was about a method of analyzing the 'oo-ness'/coupling of a java ... tool itself scored a 100%:) If I recall correctly, ... The article explained the opinion of the author that a package in Java ... should either completely be an 'interface' (consisting of only interfaces ...
    (comp.object)
  • Looking for Java metrics article and tool
    ... The article was about a method of analyzing the 'oo-ness'/coupling of a java ... The article explained the opinion of the author that a package in Java ... should either completely be an 'interface' (consisting of only interfaces ... solve this was a staged initialization procedure. ...
    (comp.object)
  • Re: jar, package and import relationship?
    ... Specifically, what do I need to put into a .java that goes into a jar that has just an interface, in order to be able to import just the interface in another .java and build against that interface? ... package foo.bar.baz.if; ...
    (comp.lang.java.programmer)
  • Re: Package level interfaces
    ... >> But isn't there a way to create an interface that can only be ... >> classes in the same package? ... Sun Certified Developer for the Java 2 Platform ...
    (comp.lang.java.programmer)
  • Re: A way of passing functions as arguments in Java?
    ... written to meet a similar aim for a package in Java. ... implement the interface arithmetic, giving multiply, add, subtract, and ...
    (comp.programming)