Wednesday, October 19, 2005

Is Java a “Specification” (or) “Language” ?

Sun likes to call Java a "platform", which includes several components: the Java Language, the Java Virtual Machine, and the Java Standard Edition Platform Libraries. Yes, it's a specification rather than an implementation. Some languages are defined by a single implementation -- these tend to be languages with complex but informally described runtime support like Python, Perl, and Ruby. Most "important" languages are defined instead by a specification or standard: and C, C++, and Java are among these. This means that there can be multiple implementations.

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 Test

Java Test

Java Answers


Polymorphism

class ValHold{

public int i = 10;

}

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