i have created a program which prompts the user for the size of an isoceles triangle and then displas the triangle with that many lines but according to myy project it alsso have to inclue drawBar() method and Addspace method which prints the space how can i do that

int size;


System.out.print("Enter Size: ");
size = input.nextInt();

int temp = size;

for (int i = 1; i <= size; i++){
for (int j = temp; j > 0; j--){
System.out.print(" ");
}

for(int j = 0; j < i; j++){
System.out.print("*");
System.out.print(" ");
}
System.out.println();
temp--;
}