Back to feed
Renewal·서른의 생활코딩

ex14) java

NS
normalstory
cover image





class Test06{
        void Star(int st){     
                // the number of [types + parameters] must match!!! -> `int` declaration
                // `st` = parameter = user-defined name
                // when execution reaches the code `int st`, memory is allocated
                // and when the Star function scope ends, that memory disappears
                // local variable `st = 50` (not assignment in concept, but initialization!!!)
        int i;
        for(i=0;i<=st;i++){
                System.out.print("*");
                //if(i==10) return;
                }
        System.out.print("\n");
        // return;
        }
}

public class fun06 {
        public static void main(String[] args) {
        Test06 t = new Test06();
        t.Star(50);  // type + parameter count must match!!! (see above)
        System.out.println("Hello Java");
        t.Star(40);  
        int a=1;
        t.Star(a);  
        }

}

This English version was translated by Codex.

친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.

More on the author's page

Keep reading

Renewal

Why You Should Use .html Instead of .md Seeing Is Believing

Jul 25, 2026·1 min
Renewal

The Most Important Thing About AX

Jul 17, 2026·2 min
Renewal

디지털 기술과 혁신에 대한 논고(지탱하는 힘)

Jul 17, 2026·5 min