개발스토리지😃

[Java] 자바코드 시각화 도구 Java Visualizer 본문

언어/자바

[Java] 자바코드 시각화 도구 Java Visualizer

believekim 2025. 2. 25. 23:26

 

 

자바코드의 실행과정을 시각화로 볼 수 있는 Java Visualizer를 소개해보고자 한다.

 

 

 

https://cscircles.cemc.uwaterloo.ca/java_visualize/

 

Java Visualizer

Write your Java code here: args: +command-line argument stdin (also visualizes consumption of StdIn) x <!-- Execute code using Python 2.7 Python 3.3 , --> <!-- these two make sense, but are not implemented yet hide frames of exited functions show frames of

cscircles.cemc.uwaterloo.ca

 

 

1. 코드 소개

  • main에서 이름을 할당하여 주고 Person객체를 만들어 소개기능을 출력해주는 코드이다.
public class Main {
    static class Person {
        // 1. 속성
        String name;
        // 2. 생성자
        Person(String name) {
            this.name = name;
        }
        // 3. 기능(이름출력)
        void introduce() {
            System.out.println("나의 이름: " + this.name);
        }
    }

    public static void main(String[] args) {
        String name = "Tom";
        Person p1 = new Person(name);
        p1.introduce();
    }
}

 

 

 

2. 위 코드를 복사, 붙여넣기 후 시각화도구를 실행

 

 

 

3. 디버그하듯이 실행흐름을 단계별로 확인

  • Frames : Stack Area
  • Objects : Heap Area
  • Method Area은 확인불가