Created
December 18, 2017 10:26
-
-
Save aperture147/46afa6c15e574045c60b59dec7fb4dca to your computer and use it in GitHub Desktop.
Scanner Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class MainApp { | |
public static void main(String[] args) { | |
String ten; | |
int tuoi = 0; | |
String diachi; | |
Scanner input = new Scanner(System.in); | |
System.out.print("Nhap ten: "); | |
ten = input.nextLine(); | |
System.out.print("Nhap tuoi: "); | |
tuoi = input.nextInt(); | |
System.out.print("Nhap dia chi: "); | |
diachi = input.nextLine(); //dòng lệnh ở đây có vẻ không hoạt động | |
System.out.printf("Ten: %s, tuoi: %d, dia chi: %s", ten, tuoi, diachi); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment