Java, for web and portable applications
Java was built by Sun's programmers in 1995, in reply to the uncompatibility
between various systems and libraries they have to deal with. The first
version, named Oak, was targeted at embedded system, but with no success.
The emergence of Internet gave the language another chance.
It was funded on C++
to avoid the teaching of a new syntax, but eliminates lots of drawbacks in
C++.
Java is now one of the most widely used programming language, mainly
on networks and for web service. It is a property of Oracle since 2009.
Java is the main language for the Android operating system, for mobile phones, where it is be compiled for the Dalvik virtual machine.
With App Inventor it allows fast and easy application development.
Features
- Syntax similar to C's one.
- Pointers doesn't exist in Java. Object are passed by reference, simple variables by value.
- Garbage collector and multi-threading are built in.
- Each file holds a single public class.
- Multiple inheritance and overloading of operators are missing. Generic functions are supported.
- Applets are programs that run through the Web embedded inside HTML pages.
- Compiled to portable bytecode, each system has its own virtual machine to run it.
- SWT is a GUI library using components of the system.
- Swing builds its own interface components.
Sample code
Merging and displaying lists.
String s = new String("demo");
for(int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
System.out.print(c);
}
Why use Java?
Using Java rather than C++ improve productivity. Along the
free compiler comes a complete collection of APIs, graphical and other,
that is a standard.
Java Programs are slower that C++ ones, take a while to load, but they run under Windows, Linux, Mac and so ones...
You can insert Java
applets inside web pages.
It is also a plateform for web services, allowing to consult
databases from within Internet.
Apps for android mobile phones are made in Java. See programming mobiles for an overview of all systems and how to develops on each platform.
IDEs for Java
Eclipse and WindowBuilder
Since the version 3.7 of Eclipse, this development tool now includes a new graphical user interface designer acquired by Google and offered to the foundation.
Like Dreamweavers, WindowBuilder has a bi-directional code generation, that is what we build in visual mode is translated into the source code and what is written in the source code is translated into graphics, this instantly without having to redisplay the page. It supports SWT and Swing.
NetBeans
Since 6.9 it includes a composer for JavaFX. The JavaFX language is designed to easily create graphical user interfaces in Java, with a more visual approach.
The new version of the NetBeans editor offers it a graphical development tool.
It still allows to program in PHP, C++ and also editing HTML and CSS codes.
But the goal is promoting JavaFX as a competitor to HTML 5, Silverlight and Flash to build web applications.
App Inventor: Creating Android applications with no programming
It is a visual development tool like Visual Studio where each component corresponding to a function on an Android phone has a block that you can set up and insert in the interface that you are building.
It is based on the OpenBlocks java library from the MIT.
This should make creating an application very easy and quick!
- Eclipse
IDE and tool integrator. (Windows, Mac, Linux) - NetBeans
IDE from Sun written in Java, for Java and other languages. A server is embedded. Free and open source. (Windows, Mac, Linux) - IntelliJ IDEA
Similar to NetBeans, it offers various licenses depending on the type of application. It is a simple and complete tool for Java, JavaFX and other languages, and for mobile applications. Code assistance to HTML 5, Node.js and others. (Windows, Mac, Linux).
Compilers et libraries
- Oracle
Oracle delivers a free compiler with a full API collection in the SDK. - Kaffe
Another free compiler with classlib. - GCJ
Java or bytecode compiler to binary. (Win/Lin). - Artificial intelligence algorithms in Java.
Other tools
- Jboss.org
Server of Java applications, open source. - Contract for Java
By Google, helps to find origine of bugs. - NestedVM
Converts C or C++ code to bytecode for the JVM.
