.
자바 / 콘솔창에 문자열 출력하기
System.out.println
자바의 System.out.println 메서드는 콘솔창에 문자열 출력을 출력한다.
텍스트, 변수, 연산 결과 등을 화면에 표시하고, 디버깅 과정에서 가장 많이 활용된다.
사용법
.
System.out.println("출력할 문자열");
.
예제 코드
.
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Hello, Java!");
System.out.println("자바~ 안녕~");
}
}
.
결과 화면
.
.
댓글
댓글 쓰기