
****** *
* *
***********
* *
* ******

Hello Friend;
below is the code :
public class Pattern { public static void main(String[] args) {
int iMin = 1, iMax = 8, iMid; // give max. value in even no.
int jMin = 1, jMax = 12, jMid; // give max. value in even no.
iMid = iMax / 2;
jMid = jMax / 2;
for (int i = iMin; i < iMax; i++) {
for (int j = jMin; j < jMax; j++) {
if (i % iMid == 0 || j % jMid == 0 || (i == iMin && j < jMid)
|| (i == iMax - 1 && j > jMid)
|| (i > iMid && j == jMin)
|| (i < iMid && j == jMax - 1))
System.out.print("* ");
else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
Anuj Kumar (Knapster)
I thing this will print your desired pattern. :)

thnk u boss
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.