컴퓨터 프로그래밍 A+
- 최초 등록일
- 2019.12.17
- 최종 저작일
- 2019.12
- 29페이지/ 한컴오피스
- 가격 3,000원
목차
없음
본문내용
▶StringTest
public class StringTest {
public static void main(String[] args) {
String name = "박지성";
System.out.println("이름 : "+name);
System.out.println(name.length());
System.out.println(name.charAt(0));
System.out.println(name.concat("귀하"));
}
}
이름 : 박지성
3
박
박지성귀하
▶FirstProgram
public class FirstProgram {
String hello;
FisrtProgram(){};
public void print() {
System.out.println(hello);
}
}
▶Ex_FirstProgram
public class Ex_FirstProgram {
public static void main(String[] args) {
FirstProgram fp = new FirstProgram();
fp.hello = "안녕하세요, 첫 프로그래밍입니다.";
fp.print();
FirstProgram fp2 = new FirstProgram();
fp2.hello = "Hello. This is my first program";
fp2.print();
}
}
안녕하세요, 첫 프로그래밍입니다.
Hello. This is my first program
<중 략>
▶Circle_예제
class Circle_예제 {
final double PI = 3.14;
double radius;
double area;
public void calculatingArea() {
area = PI * radius * radius;
System.out.println("원기둥의 밑면적은 " + area + "이다.");
}
}
참고 자료
없음