Introduction to java programming

Java is an object oriented programming language , whose syntax resembles C + + language . It was developed in 1990 by the company Sun Micro systems and formally introduced in 1995. This is the detailed article on java programming about its introduction, features, usage and programming concept.

This development was in a project called Green, to create a universal remote (Star 7, introduced in 1992) with an operating system capable of managing all the appliances in the house. Since C + + had too many difficulties, James Gosling, one of the actors of the project (now considered the father of Java) decided to create an object oriented language incorporating the main features of C + +, eliminating its difficult points, and making it less cumbersome and more portable (it should be integrated into any device ...). Thus, this language was initially called Oak (Oak meaning oak). However, since that name was already used, it was renamed in honor of Java's favorite drink programmers, that is to say, the coffee, one part of the production comes from the island Java.

At the same time, the Web made ??its appearance, or Java possessed all the characteristics that make it a suitable language for the Web:

  • Network of networks bringing together on the same structure different machines, it was a language capable of running on each of them: Java was designed to be portable

  • The web was limited in bandwidth: Java was designed to be small

  • In 1994, the team decided to develop a browser (called HotJava) integrating Java and able to run applets (small applications running in a browser). Thus the end of 1995 was a terrible Java development with the support of Netscape, which was soon to include Java in the browser.

    Comparison of Java and C++

    The Java language has a syntax very similar to C + + but is much more oriented programming object. Critical characteristics of C + + (those causing major errors) have not been included. It includes:
  • Pointers

  • Overload operators

  • Multiple inheritance (replaced by the notion of interface)

  • In contrast:
  • Freeing memory is transparent to the user (through a garbage collector)

  • Exception handling is much more rigorous

  • Strings and arrays are objects that are part of the language

  • However, Java is slower than C + +, as it is interpreted by a virtual machine. It loses in speed it gains in portability.

    Versions of Java

    The Java language is not fixed in time, it moves, additions to the language are regularly offered, and the standard API is continuously enriched classes from 200 to nearly 4,000 between the first and "last" version:
  • JDK 1.0 (1996): This is the first stable version of the language, thus supports all browsers.

  • JDK 1.1 (1997): It provides syntax improvements and progress at the AWT user interface and exception handling.

  • J2SE 1.2 (1998): version "2" provides multimedia enhancements. It allows for example the use of advanced graphical user interface with Swing, and the ability to interact with it by using drag and drop

  • J2SE 1.3 (2000): Improved multimedia continues with the appearance of the Java Sound API.

  • J2SE 1.4 (2002): Multimedia ever, with a library of image management.

  • J2SE 5.0 (2004): Adds new features to the language, such as annotations, enumerations, the loop "for each", the variable number of arguments (vargs), or the automatic conversion between primitive types and their wrapper classes.

  • Java SE 6 (2006)

  • Java SE 7 (2011)

  • Source file, compilation and virtual machine

    The source file of a program written in Java is a simple text file with the extension by convention. java. This source file should not be formatted, that is to say, a text file in its simplest form, without special formatting (no text underlined, italicized, or other). In contrast, the Java language supports Unicode characters, we can introduce special characters, accented letters in particular. When the program is ready to be "tried" it is to compile (translate it into machine language) using a compiler. However, unlike traditional compiled languages ??for which the compiler creates a binary file executable by a given processor (that is to say, a binary file containing specific instructions for a processor), the Java source code is compiled into a intermediate language (called pseudo-code or bytecode) showing all files with the extension. classes class that developed in the source code. This characteristic is most, because it is what makes a program written in Java is portable, that is to say, it does not depend on a given platform. In reality, the intermediate code is executable on any platform without the presence of a virtual machine, an interpreter (virtual machine is also sometimes called Java interpreter) running on a given platform, and is capable of interpret the byte code. Thus, for a bit platform (Windows 95, Unix, Linux, Amiga, ...) has a virtual machine running on their system, it is capable of running any Java application!
    In this way, all browsers can use applets have a virtual machine.


    How to write things in Java is important. Java is such sensitive (in English case sensitive) mean by that a name containing uppercase is differentiated by the same name written in lowercase. Thus, the Java language specification state that the main function must be called main () and not Main () or MAIN (). On the other hand, any statement ends with a semicolon.

    Applications and Applets

    Java allows you to create two types of programs:
    Applications: Programs as we know, that is to say in the running operating system if you have installed a virtual machine. Here's what looks like a Java application:

    public class {progname
    public static void main (String args []) {
    System.out.println ("Hello World");

    Applets (pronounced Applets, Applets and translate the name given grotesque in French): These small applications designed to run on a browser. Thus an applet has a scope much smaller than an application for safety reasons (an applet can not access the example system on which it runs ...). Here is an example applet:

    public class extends Nom_de_l_applet java.applet.Applet {
    public void paint (Graphics g) {
    g.drawString ("Hello World", 20,40);

    Add comments

    When a program is long and complicated it may be interesting (it is even advisable) to add comment lines in the program, that is to say portions of the source file that are intended to explain how program without the compiler does not take into account (because it would generate an error). To do this, it is possible to use tags that will help define the explanations so that the compiler ignores them and goes directly to the rest of the file.
    These are delimiters / * and * /. Comments will be noted as follows:

    / * This is a comment! * /

    There are a few rules:
  • Comments can be placed anywhere in the source file

  • Comments can not contain the delimiter end comment (* /)

  • Comments can not be nested

  • Comments can be written on several lines

  • Comments can not cut a word program in two

  • The language also allows you to put all the end of a line comment using the double slash (/ /). All that is to the right of this symbol will be commented out.

    / / This is another comment!

    A last type of feedback is used to document an application, so that the program JavaDoc (supplied with [javajdk.php3 JDK], Java Development Kit, the kit to compile Java) can create HTML documents from the application to the document. These comments, as seen by normal Java comments are denoted by the delimiters / ** and * /.

    Related Articles

    The conditional structures in java programming

    Conditional structures are the instructions that test whether a condition is true or not. These conditional structures can be associated with structures that are repeated according to the fulfillment of the condition, we call these structures of loop structures. This is the detailed article on conditional structures in java programming.

    Methods In JAVA With Its Types And Example Of Each Type

    Java called functions as methods. Methods achieves reusability of Java. Methods in Java can be used in various way as per the requirements of the program. Methods can take arguments and can return values to the calling function based on return value and arguments it takes it classified in various categories.

    What is difference between an Interface and Abstract class in Java?

    Are you looking for an article which explains the concepts of an Interface and Abstract class in simple language? Then your search ends here. Read this article, herein the detail about abstract class and an Interface is given. Also the important differences between an Interface and Abstract class is in Java is explained. This article highlights the important aspects regarding whether abstract class to be used or an Interface is to be used for given requirement of Enterprise application.

    What is Serialization and Deserialization in Java with examples

    In this article, I will explain about what is serialization and deserialization with example, advantages and disadvantages of serialization, constructors and their methodology and methods of deserialization, serializable interface, externalizable interface.

    More articles: Java programming Java


    Author: Mary Magdalene30 Jan 2021 Member Level: Bronze   Points : 3

    An article worthy of applause.Features of java are as follows:
    1.Java is a simple language which has the bare-bone functionality.
    2.Java is object-oriented;wherein programs' data is represented by objects.
    3.Java has been designed for the distributed environment of the internet.A package called remote method invocation(RMI) in Java helps in client/server programming.
    4.Java is interpreted and compiled language.
    5.Java is a robust language.
    6.Java is a secure language.
    7.A java executable file can run on any computer hardware or operating system that supports the java runtime environment.
    8.Java code is portable.
    9.A high-performance language.

    Author: Umesh31 Mar 2021 Member Level: Platinum   Points : 4

    Java is still a very prominent language in the vast of computer languages available today. Many people learn it for developing codes for mobile platforms. Many things will not work on your devices if proper Java applets are not available there. There are many versions of Java and presently Java 8 is the one that is mostly in use though older versions are also there being used by some people across the world. Earlier, Java's main vendor was Oracle but now it is becoming common with so many vendors like IBM, AdoptOpenJDK, Azul, Pivotal, SAP, Sun, Debian etc. It shows that Java is being more required and popular than it was in earlier times. If we consider the top computer languages as of today then Java figures in that lot which also contains others like JavaScript, Python, PHP, C#, C++, Ruby, CSS etc.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: