·  JAVA – Introduction

 

- Info:

  - JAVA is OOP-Object Oriented Programming Language.

  - JAVA is platform independed which means that it can run on any OS-Operating System.

    System must have JVM-Java Virtual Machine installed which is capable of running JAVA intermediate code.

  - JAVAs goal was to bring order in the world of programming languages ruled by C, C++ an PERL.

    All the tasks that could be done by computer were trasfered from programmer to computer.

    This is why JAVA has no headers since it is masrt encough, unlike C compilers, to find function definition on its own.

    JAVA has no pointers and all the job of cleaning objects from memory is taken care by Garbage Collector.

  - JAVA has no pointers which makes direct access to memory impossible.

  - JAVA has Garbage Collection which takes care of cleaning objects from memory which are not needed anymore.

  - JDK-Java Development Kit is collection of files and applications needed to create JAVA applications.

  - JRE-Java Runtime Environment is collection of files and applications needed to run JAVA applications.

 

- Preferred Highlighting:

 

  - Test:

    /* Multyline

       Comment    */

   

    public class Test {

   

      public static void main(String[] args) {

        System.out.println("Hello World."); //Single line comment.

      }

      

      public static int myFunc(int param) {

        return param+10;

      }

    }

    

  - Comments:

    

 

Red

Green

Blue

Bold

Example

 

Keyword 'return'

0

128

0

N

/* Multi-line

   comment.   */

 

Keywords excluding 'return'

0

128

0

N

//Single line comment.

 

  - Code:

    

 

Red

Green

Blue

Bold

Example

 

Keyword 'return'

0

0

255

Y

return

 

Keywords excluding 'return'

0

0

255

Y

public

 

Local variable declarations

0

0

0

N

args

 

Local variable references

0

0

0

N

param

 

Method declarations

0

0

0

Y

main

 

Methods

0

0

0

Y

println

 

Numbers

200

0

200

N

10

 

Strings

200

0

200

N

"Hello World"

 

- Pros:

  - Can run on different Operating Systems as long as Java Virtual Machine is installed.

  - Clean and simple syntax.

 

- Cons:

  - Infinite number of Development Environments having to use them all for their specific features or project needs.

  - Inifnite number of Web Servers having to use them all for their specific features or project needs.

  - Infinite number of frameworks telling you how to create GUI, Web Site or connect to DB.

  - Infinite number of APIs to achieve the same task.

  - Slow and ugly GUI

  - Several years old APIs like Java Media Framework.

  - Out of the box support only for basic tasks.

  - Multiple requests share Servlet variables.

  - No multi line strings.