Java (programming language): Difference between revisions

From Simple English Wikipedia, the free encyclopedia
Content deleted Content added
I don't believe the latest changes should remain
Line 6: Line 6:
Java is [[Object-oriented programming|object oriented]]. Java code looks a lot like [[C++]] or [[C (programming language)|C]] code. Unchanged C++ or C code will not work in Java, in most cases.
Java is [[Object-oriented programming|object oriented]]. Java code looks a lot like [[C++]] or [[C (programming language)|C]] code. Unchanged C++ or C code will not work in Java, in most cases.


Java can run on many different [[operating system]]s. This makes Java [[Platform independence|platform independent]]. Java does this by making the Java [[compiler]] turn code into Java [[bytecode]] instead of [[machine code]]. This means that when the program is [[Execution (computing)|executed]], the [[Java Virtual Machine]] interprets the bytecode and translates it into machine code. Its the best programming object
Java can run on many different [[operating system]]s. This makes Java [[Platform independence|platform independent]]. Java does this by making the Java [[compiler]] turn code into Java [[bytecode]] instead of [[machine code]]. This means that when the program is [[Execution (computing)|executed]], the [[Java Virtual Machine]] interprets the bytecode and translates it into machine code.


==Basic concepts==
==Basic concepts==
Line 43: Line 43:
*Java has no unsigned integer types, which languages like C heavily use. This also means that its impossible to directly exchange numeric data between C and Java programs. [[Cryptography]] also relies on such types to some extent; this makes it more difficult to write applications that use cryptography in Java
*Java has no unsigned integer types, which languages like C heavily use. This also means that its impossible to directly exchange numeric data between C and Java programs. [[Cryptography]] also relies on such types to some extent; this makes it more difficult to write applications that use cryptography in Java
*The [[IEEE]] has defined a standard for floating-point arithmetic, [[IEEE 754-2008|IEE 754]]. Java only supports a part of the features of this standard.
*The [[IEEE]] has defined a standard for floating-point arithmetic, [[IEEE 754-2008|IEE 754]]. Java only supports a part of the features of this standard.

==Other programming languages==
''This list is incomplete, please expand it.''
* [[Basic]]
* [[QBasic]]
* [[Yabasic|YaBasic]]


==References==
==References==

Revision as of 16:43, 17 September 2011

Java is a programming language that can run on many different computers including mobile phones. It was created by Sun Microsystems and released in 1995. Small Java programs, called applets, usually run inside web browsers.

Java is not the same as JavaScript. JavaScript is a scripting language mainly used by web browsers.

Background

Java is object oriented. Java code looks a lot like C++ or C code. Unchanged C++ or C code will not work in Java, in most cases.

Java can run on many different operating systems. This makes Java platform independent. Java does this by making the Java compiler turn code into Java bytecode instead of machine code. This means that when the program is executed, the Java Virtual Machine interprets the bytecode and translates it into machine code.

Basic concepts

When Java was developed, this was done to reach five goals:[1][2]

  • It should be simple, object-oriented, distributed and easy to learn.
  • It should be robust and secure
  • It should be independent of a given computer architecture or platform
  • It should be very performant
  • It should be possible to write an interpreter for the language. The language should also support parallelism and use dynamic typing.

Platform

The Java platform refers to a group of software products from Sun Microsystems. The platform is used to develop and run Java programs. The platform includes the execution engine (called a Java Virtual Machine) that allows Java programs to do the same thing on different computer systems.

Example

An example Hello World program:

public class HelloWorld {
  public static void main(String[] args) {
     System.out.println("Hello, world!");
  }
}

Types of Java

There are many types of Java programs which run differently:

  • Applet - can be put online (in web browsers).
  • Application - can only be run on the computer, cannot be put online.
  • Servlet - runs on a server and helps to display web pages.
  • Swing application - like an application, but can have a more graphical look.
  • ejb - an application for business purpose

Criticism

The programming language Java has also been criticised. Some of the criticisms are:

  • Generics were added to Java in such a way so that existing code would still keep running. This was done using type erasure. This means that during compilation, the actual type of a generic argument is removed. This can lead to the Java interpreter to behave in unexpected ways at times.
  • Java has no unsigned integer types, which languages like C heavily use. This also means that its impossible to directly exchange numeric data between C and Java programs. Cryptography also relies on such types to some extent; this makes it more difficult to write applications that use cryptography in Java
  • The IEEE has defined a standard for floating-point arithmetic, IEE 754. Java only supports a part of the features of this standard.

References

Other websites

Template:Link FA Template:Link GA