By GokiSoft.com| 19:36 12/04/2024|
Java Basic

[Share Code] Tìm hiểu Java 1 - Cài đặt môi trường - C2307L

Nội dung kiến thức:
	Kiến thức cơ bản
		- Cài đặt môi trường
		- Khai báo biến & toán tử
		- Mệnh đề điều kiện (if, else, ...)
		- Loop
		- Array
	Kiến OOP
		T/c trong lập trình hướng đối tượng
			Tính bao đóng
			Tính kế thừa
			Tính trừu tượng
			Tính đa hình

		Interface
		Cú pháp lambda
		Một số hàm trong Java
	Java Swing
=======================================================
Buổi học hôm nay:
	- Cài đặt môi trường
		- JDK
			8
			11
			17
			18
			22
	- Viết dự án hello world
		- Deploy dự án -> Bàn giao cho KH
	- Khai báo biến & toán tử
	- Mệnh đề điều kiện (if, else, ...)
	- Loop

#pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.gokisoft.c2307l</groupId>
    <artifactId>C2307L</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>18</maven.compiler.source>
        <maven.compiler.target>18</maven.compiler.target>
        <exec.mainClass>com.gokisoft.c2307l.C2307L</exec.mainClass>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>com.gokisoft.c2307l.C2307L</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

#Test02.java

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.gokisoft.c2307l;

/**
 *
 * @author diepvan
 */
public class Test02 {
    void abc() {
        System.out.println("sdsfsdf");
    }
}

#Test01.java

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.gokisoft.c2307l;

/**
 *
 * @author diepvan
 */
public class Test01 {
    public static void main(String[] args) {
        System.out.println("OKOKOK");
    }
}

#C2307L.java

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${packagePath}/${mainClassName}.java to edit this template
 */

package com.gokisoft.c2307l;

/**
 * @author diepvan
 * C2307L -> Class Object (Trung vs ten File)
 */
public class C2307L {
    public static void main(String[] args) {
        System.out.println("Hello World!");
        System.out.println("Xin chao");
    }
    
    void abc() {
        //Code
        //Code
    }
}
Tags:

Phản hồi từ học viên

5

(Dựa trên đánh giá ngày hôm nay)