By GokiSoft.com| 21:26 11/03/2020|
Java Basic

Share Code- Chia sẻ code lession 1 - Lớp C1907L

Soure Code


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package aptech;

import java.util.Scanner;

/**
 *
 * @author Diep.Tran
 */
public class Test {
    public static void main(String[] args) {
        final int k = 5;
        
        System.out.println("Test....");
        
        System.out.println("User Name: " + "Tran Van Diep");
        System.out.format("\nUser Name: %s, Age: %d, dia chi: %s\n", "Tran Van A", 12, "Ha Noi");
        
        String username = "Tran Van A";
        char c = 'A';
        int x = 5, y = 7;
        float t = 1.2f;
        
        System.out.println("User Name : " + username);
        System.out.format("\nUserName : %s, c = %c. x = %d, t = %f", username, c, x, t);
        
        //Java => thuc hien nhap du lieu tu ban phim bang cach nao
        //Khai bao nhap tu ban phim
        Scanner input = new Scanner(System.in);
        
        System.out.println("\nNhap username = ");
        username = input.nextLine();
        System.out.println("User Name : " + username);
        
        System.out.println("Nhap x = ");
        x = input.nextInt();
        
        System.out.println("x = " + x);
    }
}



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package aptech;

/**
 *
 * @author Diep.Tran
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("Hello World!");
    }
    
}



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package aptech;

/**
 *
 * @author Diep.Tran
 */
public class Abc {
    public static void main(String[] args) {
        System.out.println("Hello Abc");
    }
}


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

5

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