Site Search:

Compare and contrast the features and components of Java such as: platform independence, object orientation, encapsulation, etc.

Back OCAJP
oracle java
oracle java

C++ has operator overloading and pointers. Java don't have operator overloading and pointers.

Java have references to objects, it also support method overloading and method overriding.

Java is platform independent. 

Java is objet oriented language.

Java is not procedural language, not functional programming language.
JVM
JVM



In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM or JVM). The java launcher tool then runs your application with an instance of the Java Virtual Machine.
source file - .class file - bytecode
source file - .class file - bytecode


Java Runtime Environment (JRE) is a software package that contains what is required to run a Java program. It includes a Java Virtual Machine implementation together with an implementation of the Java Class Library. The Oracle Corporation, which owns the Java trademark, distributes a Java Runtime environment with their Java Virtual Machine called HotSpot.

Java Development Kit (JDK) is a superset of a JRE and contains tools for Java programmers, e.g. a javac compiler. The Java Development Kit is provided free of charge either by Oracle Corporation directly, or by the OpenJDK open source project, which is governed by Oracle.

Q: What are the following are true?

A. java program compiled in windows can be run on linux.
B. java language support method overloading
C. java language support operator overloading
D. java is object oriented language
E. java is functional programming language
F. in order to run a java program, java compiler is required

A: A, B, D
Explain: java is platform independent. javac compiler compiles the .java source code into .class bytecode. On windows, linux and other platforms, as long as there is JRE, the byte code can be run in the JVM. A is correct. F is incorrect, because java compiler is not required to run a java program, JRE is required to run a java program. Java support method overloading not support operator overloading. B is correct, C is incorrect. Java is object oriented language, not functional programming language or procedure language, D is correct, E is incorrect.

Back OCAJP