Object Oriented Programming - Lesson 2.1: Java syntax basics

Object Oriented Programming - Lesson : Java syntax basics Understand the Java syntax basics and their semantics for writing a program. It includes Structure of a Java program, White space, Separators, Comments, Identifiers and keywords, Data types and literals, Comment line arguments. | LESSON Java syntax basics Trinh Thanh TRUNG (MSc) trungtt@ Objectives • Understand the Java syntax basics and their semantics for writing a program. Structure of a Java program Program • Package – Class • Methods – block » Statement • Expression • Token Book • Part – Chapter • section – Paragraph » Sentence • Phrase • Word Content • • • • • • White space Separators Comments Identifiers and keywords Data types and literals Comment line arguments I. White spaces • A whitespace is a space, a tab or a new line. • It is used to separate the tokens in a source file and to improve readability • Java don’t require indentation rules – Example: following codes are equivalent package firstpackage; public class SayHello { public static void main(String[] args) { // Display Chao! on the screen ("Chao!"); } } package firstpackage; public class SayHello { public static void main(String[] args) { // Display Chao! on the screen ("Chao!"); .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
7    76    2    02-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.