Please could you give the comments too and be very detailed while writing the program.
  Complete JAVA code with explanation:   import java.util.Scanner;   public class Lab07{           public static void main(String[] args) {         // scanner object to read user's input         Scanner input = new Scanner(System.in);         // prompt user to input size of triangle         System.out.print("Enter size of triangle (1 to 9) inclusive: ");         int size = input.nextInt();           // if the input is not valid         while(size<1 || size >9){             System.out.println("Invalid input!! Enter again: n");             // prommpt user again to input size             System.out.print("Enter size of triangle (1 to 9) inclusive: ");             size = input.nextInt();         }         // for the size n, there will be n rows         for(int i=1; i<=size; i++){             // print the n-i spaces in ith line of triangle             for(int j=1; j<=size-i; j++){                 System.out.print(" ");             }   &# ... See the full answer