You are on page 1of 14

Lập trình HĐT - OOP

Học liệu: sites.google.com/view/caominhthanh, SĐT: 0937324778


Java (Class, Thừa kế, Đa hình, Giao diện): Console, không có xây
dựng JFrame/Form
Cú pháp Java cơ bản
Bài kiểm tra: 4 bài kiểm tra thực hành (1-2 người làm chung)
Bài project cuối học phần (nhóm 4-5 người)
Thi: tự luận
Cài phần mềm:
- Netbean 12.0/12.5 (JDK >=8.0)
- Netbean 8.0/ Visual Code/ Ellipse
- Notepad++
Học bù: 17/10, 31/10, 14/11, …

1 Annual Review 11/13/21


Introduction Java

Cao Minh Thành


Trường Đại học Sài Gòn
08/2021
1. Nội dung

 how to create compile, and run very basic Java programs

Introduction 11/13/21 3
2. Introduction

 Java là ngôn ngữ lập trình mạnh  Java is cross-platform, object


mẽ, có mặt khắp nơi, thời thượng oriented, network-based and
(hot). multimedia ready.
 Cho phép xây dựng ứng dụng: the
internet for servers, desktop
computer and handheld devices.
 Java là ngôn ngữ hướng mạng
internet.
 Được thiết kế đáp ứng các tiêu chí:
simple, secure and usable for
many different processor types.

Introduction 11/13/21 4
2. History of Java
 Was developed by Sun Microsystems (a team led by Jame
Gosling).
 Originally called Oak.
 Was designed in 1991 for use in embedded consumer
electronic application.
 1995 renamed Java (26 year ago)
 It was redesigned for developing Internet application.
 Web application, standalone application.

Introduction 11/13/21 5
2. History of Java

Introduction 11/13/21 6
3. The way java works

Introduction 11/13/21 7
4. Characteristic of Java

Write a program one and run the program any where.

object-
simple distributed interpreted
oriented

Architecture-
robust secure portable
neutral

high-
multithreaded dynamic
performance

11/13/21 8
5. The Java Language Specification, API, JDK, IDE

• The Java language specification is a technical definition of the Java


programming language’s syntax and semantics.
• The application program interface (API), also known as library, contains
predefined classes and interfaces for developing Java programs. The API is
still expanding.
• Java Standard Edition (Java SE) to develop client-side applications. The
applications can run standalone or as applets running from a Web browser.
• Java Enterprise Edition (Java EE) to develop server-side applications, such
as Java servlets, Java Server Pages (JSP), and Java Server Faces (JSF)
• Java Micro Edition (Java ME) to develop applications for mobile devices,
such as cell phones.
• Java development tool (e.g., NetBeans, Eclipse, and TextPad)—software that
provides an integrated development environment (IDE) for developing Java
programs quickly.

11/13/21 9
A simple Java program

• A Java program is executed from the main method in the class

- package: grouping and organizing classes


- Every Java class must have at least one class.
- Each class begins with a class declaration that defines data and methods for
the class.
- The class contains a method named main

11/13/21 10
A simple Java program

11/13/21 11
6. Creating, Compiling, and Executing a Java Program

• You save a Java program in


a .java file and compile it into
a .class file.
• The .class file is executed by
the Java Virtual Machine.

11/13/21 12
6. Creating, Compiling, and Executing a Java Program

• the virtual machine is a program that interprets Java bytecode.


• Java bytecode can run on a variety of hardware platforms and operating systems

11/13/21 13
7. Demo

• Simple java class


• Notepad++
• Dịch bằng javac

11/13/21 14

You might also like