Is Java a “Specification” (or) “Language” ?
The Java language is defined by the Java Language Specification. It's like asking whether something that looks like a horse is a horse or a mammal. It's both!
Java HAS-A specification like every other computer language. Java IS-A computer language. Java is accompanied by a rich set of standard libraries, written in Java. Java is usually executed on a Java virtual machine.
Core Java - 30 Question TestJava Test
Polymorphism
class ValHold{
}
public class ObParm{
public static void main(String argv[]){
ObParm o = new ObParm();
o.amethod();
}
public void amethod(){
int i = 99;
ValHold v = new ValHold();
v.i=30;
another(v,i);
System.out.print( v.i );
}//End of amethod
public void another(ValHold v, int i) {
i=0;
v.i = 20;
ValHold vh = new ValHold();
v = vh;
System.out.print(v.i);
}//End of another
}



0 Comments:
Post a Comment
<< Home