入力の基本
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
long l = sc.nextLong();
String s = sc.next();
}
}
出力
public class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println(114514);
long l = 1919810L;
System.out.println(l);
String s = "javajavajava";
System.out.println(s);
System.out.print("Hello World!");
System.out.println("Hello World!");
}
}
基本の型
public class Main {
public static void main(String[] args) {
int i = 15;
long l = 114514L;
float f = 3.14F;
double d = 3.1415;
boolean b = true;
char c = 'a';
String s = "java";
}
}