• Post Reply Bookmark Topic Watch Topic
  • New Topic

are they compiled?  RSS feed

 
w.k.hasintha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey brainy java people;
when we create a java source code by default we inherit java.lang package and whole lot of classes .but when we compile our code do these all class lot compile or how can those attributes or methods can be used bythe compiler.
for example we use "length" attribute for arrays .where does this variable lives.how on the hell we use them.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please place your questions in our Java In General (Beginner) forum. In SCJP a basic knowledge of Java is a requisite. Moving to JIG (Beginner).
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lol, array is a predefined class in the java package..

and length is an inner static member data, or is it just public data?

that holds the array's

size-1 (index of an array starts at 0, not 1).

Justin
[ October 17, 2006: Message edited by: Justin Fox ]
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The import keyword in Java does not tell the compiler to compile the classes that you're importing. It only tells Java that the class you are writing uses those classes.

All the classes in java.lang and in all the other packages of the standard Java API are already compiled and they are in the file rt.jar which you can find in the lib directory of the JRE. ("rt" stands for "runtime" here).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!