#include <stdio.h>
void main(){
int a[3][2] = {{2,3}, {5}, {7}};
int i, sum = 0;
int *p;
p = a[0];
for(i=0;i<3;i++)
sum += *(p+i);
printf("%d", sum);
return 0;
}
//2 3 5 0 7 0 의 형태를 가지고 있음
//2+3+5
//10
이때 만약 i<4인 경우, 이 경우는 2+3+5+0으로 10 이 됨을 주의하자.
class Berry {
protected String str;
public void meth(){
print();
}
public void print(){
System.out.print(str);
}
}
class Apple extends Berry {
private String str;
public void print(){
str = "Apple";
super.str = "Berry";
super.print();
System.out.print(str);
}
}
public class Main{
public static void main(String [] args){
Berry c = new Apple();
c.meth();
}
}
//BerryApple
//c.meth();를 해도 같은 결과
//Apple c = new Apple();을 해도 같은 결과
#요구사항확인
#요구사항확인