meraの日記: 入れ物
日記 by
mera
class 入れ物 {
private int 容積 = 0 ;
private Object 中身 = null ;
public 入れ物( Object 中身, int 容積 ) {
this.中身 = 中身 ;
this.容積 = 容積 ;
}
public void 入れる( Object 中身 ) {
this.中身 = 中身 ;
}
public Object 出す() {
Object 出した物 ;
出した物 = this.中身 ;
this.中身 = null ;
return 出した物 ;
}
}
private int 容積 = 0 ;
private Object 中身 = null ;
public 入れ物( Object 中身, int 容積 ) {
this.中身 = 中身 ;
this.容積 = 容積 ;
}
public void 入れる( Object 中身 ) {
this.中身 = 中身 ;
}
public Object 出す() {
Object 出した物 ;
出した物 = this.中身 ;
this.中身 = null ;
return 出した物 ;
}
}
入れ物 More ログイン