new์ฐ์ฐ์๋ฅผ ์ด์ฉํด ๊ฐ์ฒด ์์ฑ
1) ํด๋์ค ์์ฑ
ํด๋์ค ์์ฑ ์๋ฃ!
package testPjt;
public class TransportationWalk {
public void move() {
System.out.println("hello");
}
}
2) ๋ฉ์ธํด๋์ค ์์ฑ
package testPjt;
public class MainClass {
public static void main(String[] args) {
TransportationWalk transportationWalk = new TransportationWalk();
transportationWalk.move();
}
}
๊ฒฐ๊ณผ ํ๋ฉด!
'๐ปWEB BackEnd > ํ๋ ์์ํฌ Spring' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
ํ๋ก์ ํธ ์์ฑ - (๋ฐฉ๋ฒ2)๋ก์ปฌ์์ ์ง์ ์์ฑ (0) | 2022.11.01 |
---|---|
๊ฐ์ฒด ์์ฑ - (๋ฐฉ๋ฒ2) ์ปจํ ์ด๋๋ฅผ ํตํด ๊ฐ์ฒด ์์ฑ (0) | 2022.11.01 |
์์ฃผ ์ฐ์ด๋ ์ดํด๋ฆฝ์ค ๋จ์ถํค (0) | 2022.11.01 |
ํ๋ก์ ํธ ์์ฑ - (๋ฐฉ๋ฒ1)eclipse์์ ์์ฑ (0) | 2022.11.01 |
java, eclipse ์ค์น (0) | 2022.11.01 |