java oop programming language (part 1) - introduction to java

Post on 06-Jan-2017

87 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Java Programming - IntroOum Saokosal

Master’s Degree in information systems, JeonjuUniversity, South Korea

012 252 752 / 070 252 752

oumsaokosal@gmail.com

Contact Me• Tel: 012 252 752 / 070 252 752

• Email: oumsaokosal@gmail.com

• FB Page: https://facebook.com/kosalgeek

• PPT: http://www.slideshare.net/oumsaokosal

• YouTube: https://www.youtube.com/user/oumsaokosal

• Twitter: https://twitter.com/okosal

• Web: http://kosalgeek.com

History

• James Gosling and Sun Microsystems

•Oak

• Java, May 20, 1995, Sun World

• Java Applet

• Java SE, Java EE, Java Java ME

• Android uses Java, doesn’t use JVM

3

Features of Java

• Java is object-oriented

• Java is interpreted

• Java is architecture-neutral

• Java is portable

• Java is multithreaded

• Java is dynamic

4

Java IDE Tools

• Eclipse

• Netbeans

• IntelliJ IDEA

5

Getting Started with Java Programming

•A Simple Java Application

•Compiling Programs

• Executing Applications

6

A Simple Application

Example 1.1//This application program prints Welcome

//to Java! package chapter1;

public class Welcome {public static void main(String[] args) { System.out.println("Welcome to Java!");

}}

7

Executing Applications

• Compile: javac Welcome.java

• Run: java Welcome.class

8

Java Interpreter

on Windows

Java Interpreter

on Sun Solaris

Java Interpreter on Linux

Bytecode

Java Interpreter on Mac OS

Comments

In Java, comments:

//this is a single line comment

/* this is

a multiline comment

*/

9

Reserved Words

Reserved words or keywords:

- class

- public

- static

- void

- int

- package

10

Modifiers

publicprivateprotected(default)

11

Classes

A class is a template or blueprint for objects.

public class Welcome {

}

12

MethodsMethod: a collection of statements that performs a sequence of operations It can be used even without fully understanding the details of how it works.

13

main MethodThe mainmethod provides the control of program flow. The Java interpreter executes the application by invoking the mainmethod.

The mainmethod looks like this:

public static void main(String[] args)

{

// Statements;

} 14

top related