1. Hello 출력.
public class Quest1 {
public static void main(String [] args) {
System.out.println("Hello");
}
}
2. Hello World 출력.
public class Quest2 {
public static void main(String [] args) {
System.out.println("Hello World");
}
}
3. Hello
World 출력.
public class Quest3 {
public static void main(String [] args) {
System.out.println("Hello\n World");
}
}
4. 'Hello' 출력.
public class Quest4 {
public static void main(String [] args) {
System.out.println("\'Hello\'");
}
}
5. "Hello World" 출력.
public class Quest5 {
public static void main(String [] args) {
System.out.println("\"Hello World\"");
}
}
6. "!@#$%^&*()" 출력.
public class Quest6 {
public static void main(String [] args) {
System.out.println("\"!@#$%^&*()\"");
}
}
7. "C:\Download\hello.cpp" 출력.
public class Quest7 {
public static void main(String [] args) {
System.out.println("\"C:\\Download\\hello.cpp\"");
}
}
8. 유니코드 특수기호 출력.
public class Quest8 {
public static void main(String [] args) {
System.out.println("\u250c \u252c \u2510");
System.out.println("\u251c \u253c \u2524");
System.out.println("\u2514 \u2534 \u2518");
}
}
'코딩목록 B > JAVA' 카테고리의 다른 글
[JAVA] 배열 Array (0) | 2022.09.19 |
---|---|
[JAVA] 반복문 (0) | 2022.08.22 |
[JAVA] 자료형 (0) | 2022.08.22 |
[JAVA] 연산자 (0) | 2022.08.21 |
객체 생성자. (0) | 2021.05.11 |