14
Java Programming - Intro Oum Saokosal Master’s Degree in information systems, Jeonju University, South Korea 012 252 752 / 070 252 752 [email protected]

Java OOP Programming language (Part 1) - Introduction to Java

Embed Size (px)

Citation preview

Page 1: Java OOP Programming language (Part 1) - Introduction to Java

Java Programming - IntroOum Saokosal

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

012 252 752 / 070 252 752

[email protected]

Page 2: Java OOP Programming language (Part 1) - Introduction to Java

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

• Email: [email protected]

• 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

Page 3: Java OOP Programming language (Part 1) - Introduction to Java

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

Page 4: Java OOP Programming language (Part 1) - Introduction to Java

Features of Java

• Java is object-oriented

• Java is interpreted

• Java is architecture-neutral

• Java is portable

• Java is multithreaded

• Java is dynamic

4

Page 5: Java OOP Programming language (Part 1) - Introduction to Java

Java IDE Tools

• Eclipse

• Netbeans

• IntelliJ IDEA

5

Page 6: Java OOP Programming language (Part 1) - Introduction to Java

Getting Started with Java Programming

•A Simple Java Application

•Compiling Programs

• Executing Applications

6

Page 7: Java OOP Programming language (Part 1) - Introduction to Java

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

Page 8: Java OOP Programming language (Part 1) - Introduction to Java

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

Page 9: Java OOP Programming language (Part 1) - Introduction to Java

Comments

In Java, comments:

//this is a single line comment

/* this is

a multiline comment

*/

9

Page 10: Java OOP Programming language (Part 1) - Introduction to Java

Reserved Words

Reserved words or keywords:

- class

- public

- static

- void

- int

- package

10

Page 11: Java OOP Programming language (Part 1) - Introduction to Java

Modifiers

publicprivateprotected(default)

11

Page 12: Java OOP Programming language (Part 1) - Introduction to Java

Classes

A class is a template or blueprint for objects.

public class Welcome {

}

12

Page 13: Java OOP Programming language (Part 1) - Introduction to Java

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

Page 14: Java OOP Programming language (Part 1) - Introduction to Java

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