Please validate Solution Pattern 19

package codingBlocks_Pattern;

import java.util.Scanner;

public class Ques_nineteen {

private static Scanner sc;

public static void main(String[] args) {
	
	sc = new Scanner(System.in);
	int n = sc.nextInt();
	
	int row = 1;
	int str = n;
	int strr1 = n/2;
	int strr = n/2;
	int spc = 1;
	

	
	while(row < n) {
		
		if(row == 1) {
		for(int i =0; i<str ; i++) 
			System.out.print("*");
		}	
		System.out.println();
		
		int str1 = 0;
		for(;str1<strr;str1++) {
			System.out.print("*");
			
		}
		
		int spc1 =0;
		for(;spc1<spc;spc1++) {
			System.out.print(" ");
		}
		
		int str2 = 0;
		for(;str2<strr1;str2++) {
			System.out.print("*");
		}
		
		
		if(row<n/2  ) {
			strr--;
			spc = spc+2;
			strr1--;
		}else {
			
			strr++;
			spc= spc-2;
			strr1++;
			
		}
		
		
		
		row++;
		
		
		
}

}
}

@k.bhupenderagile
I have edited your code. https://ide.codingblocks.com/s/154387
Added another condition in line 38.
Error was strr+strr1 was going beyond n in the last line after incrementing.