유디의 공간정보·개발일기

H3-2. 0720_ JAVA 코드 본문

JAVA

H3-2. 0720_ JAVA 코드

55yudi 2021. 10. 31. 15:32
class Person {

  public class PersonTest {

      public static void main(String[] args) {
          int age = 12;
          String name = "Anonymous";

          selfIntroduce();
          getPopulation();

    }
      private static void selfIntroduce() {
          int age = 3;
          String name = "철수";
          System.out.printf("내 이름은 %d이며, 나이는 %d살 입니다.", name, age);
      }

      private static void getPopulation() {
          int numberOfPersons = 0;
          Person persons = new Person();
          int result = numberOfPersons++;
          System.out.println(result);
      }
	
}
}

'JAVA' 카테고리의 다른 글

H3-3. 0720_CarTest 과제  (0) 2021.10.31
H3-1. 0720_ Stack/Heap영역, 변수  (0) 2021.10.31
H2. 0719_ JAVA 기초2, 응용 과제  (0) 2021.10.31
H1. 0716_ JAVA 기초  (0) 2021.10.31
7-2. 0713_ Hashmap  (0) 2021.10.24