Introduction to Java

History of Java

  • Java was released in 1996 by James Gosling at Sun Microsystems

  • "Write once, run anywhere"

  • Based on C/C++

  • OOP (Object-Oriented Programming )

Why Java?

Preparation

Installing Java SE 8

Editor

(NetBeans, BlueJ, Notepad++, etc)

Code Conventions

Naming Rules

example

Prose form correct incorrect
"XML HTTP request" XmlHttpRequest XMLHTTPRequest
"new customer ID" newCustomerId newCustomerID
"inner stopwatch" innerStopwatch innerStopWatch

Let's code...

Example Code (HelloWorld.java)


public class HelloWorld {
  public static void main (String[] args) {
    String language = "Java";
    System.out.println("Hello World");
    System.out.println("Happy Coding with " + Language);
  }
}

Introduction to Java

By Nur Ratna Sari

Introduction to Java

  • 69