to get a help about compositions!!!!!
these are 2 classes.
can anyone explain me about the things in bold and the other contents.
public class tuna{
private String name;
private potpie birthday:">;
public tuna(String nm,potpie bday){
birthday=bday;
name=nm;
}
public String hs(){
return String.format("My Name is %s, My Birthday is %s", name,birthday);
}}
public class potpie {
private int year;
private int day;
private int month;
public potpie(int y,int d,int m){
year=y;
day=d;
month=m;
System.out.printf("The date is %s\n", this);
}
public String toString(){
return String.format(" %d/%d/%d",year,day,month);
}}
Re: to get a help about compositions!!!!!
Defines a variable named birthday of type potpie.
Re: to get a help about compositions!!!!!
What do you mean by the type potpie?
Re: to get a help about compositions!!!!!
That defines a "type" named potpie.
Re: to get a help about compositions!!!!!
Can't you give another examples?
Re: to get a help about compositions!!!!!
You'll get more and better answers if you google: java data types