같은 반복문을 while 과 for 로 각각 작성 int i = 0; //반복문에서 횟수 카운트 변수 i while(i < 3) { System.out.println(2); System.out.println(3); i++; } // 2 // 3 // 2 // 3 // 2 // 3 for(int i=0; i
parameter 매개변수 // parameter 매개변수 public static void main(String[] args) { string id = args[0]; string bright = args[1]; } 실행 화살표 - Run Configurations 에서 argument(인자) 를 설정하게 되면, args 라는 parameter(매개변수)를 통하여 그 값을 활용 가능 argument(인자) 큰 따옴표로 묶어서 작성 예) "Seoul ART 401" "45.0" -> [0] , [1] 번째
변수 int a = 3 //정수 double b = 2.8 //실수 string c = "Hello" //문자 casting int e = (int) 1.1; System.out.println(e); // 실수 1.1이 정수 1로 출력 string f = Integer.ToString(1); // 숫자 1이 문자열 인식
public class StringApp { public static void main(string[] args) { System.out.println("Hello \nWorld"); //new line 줄 바꿈 System.out.println("Hello \"World\""); // escape 출력 Hello "World" } } \n 줄 바꿈 new line \ escape public class StringOperation { public static void main(String[] args) { System.out.println("Hello World".length()); //11 System.out.println("Hello, LISA ... bye.".replace("LISA","JAIN..