IT/Programming / / 2023. 4. 20. 13:31

[JAVA] System class 사용 예제

반응형
package dayday14;

/*<System Class>
 * -> java.lang
 * -> 운영체제 관련 클래스
 * 1) System.out (static 객체에 공유, 객체생성 안해도 만들어짐)
 *  - 운영체제 (cmd)을 향한 출력 stream
 * 
 * 2) System.in (static)
 *  - 운영체제(cmd)으로부터 들어오는 입력 stream
 *  
 * 3) System.currentTimeMilis
 *  - 운영체제로부터 1970.1.1 09:00 부터현재까지 경과한 ms(1000ms = 1s)를 long형으로 가지고 있음
 * 
 */
public class test01 {
	public static void main(String[] args) throws InterruptedException {
		while (true) {
			long s = System.currentTimeMillis();
			System.out.println(s);
			Thread.sleep(100);
		}
	}
}
반응형
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유