How to change the following codes to object oriented programming
import java.util.Scanner;
public class assign_star
{
public static void main(String[] args)
{
Scanner keyin=new Scanner(System.in);
int number;
do{
System.out.print("number= ");
number=keyin.nextInt();
for(int row=1;row<=number;row++)
{
for(int col=1;col<=row;col++)
{
System.out.print("*");
}
System.out.println();
}
for(int row=number-1;row>=1;row--)
{
for(int col=1;col<=row;col++)
{
System.out.print("*");
}
System.out.println();
}
}while(number!=-1) ;
}
}