All pastes #566444 Raw Edit

Something

public text v1 · immutable
·published 2007-06-14 13:22 UTC
rendered paste body
class diamondprint
{
int size;
	
diamondprint(){
size = 0;
}
diamondprint(int s){
size = s;
}

public void setsize(int s){
size = s;
}
public int getsize(){
return size;
}

public void diamond(){
int stars = 1;
boolean go_up = true;
while ( stars > 0 ){
for(int i = 0; i < stars; i++){
System.out.print("*");
}
System.out.println();
if ( go_up == true )
{
stars = stars + 2;
} else {
stars = stars - 2;
}
if ( stars == size )
{
	go_up = false;
}
}
}

}