Answer Posted / ganesh slv
/**
* Printing Stars - 24.03.10
* @author Ganesh
*/
public class Star {
/**
* Please Send me Your Comment - slvganesh.java@gmail.com
*/
public static void main (String arg[]) {
int n = 6;
for (int i=0, j=n; i<=n; i++,j--) {
for (int k=0; k<=n; k++) {
if (i==k || j==k)
System.out.print ("*");
else
System.out.print (" ");
}
System.out.println ();
}
} // Main
} // Class
| Is This Answer Correct ? | 17 Yes | 1 No |
Post New Answer View All Answers
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
Does list allow duplicates in java?
What are the advantages of passing this into a method instead of the current class object itself?
what is the difference between yielding and sleeping? : Java thread
What is the difference between replace and replace all?
What happens if we override private method?
What is a double?
What is meant by bytecode?
Similarity and difference between static block and static method ?
Can we use static class instead of singleton?
Can you change array size in java?
What is the purpose of the system class in java programming?
Can we return null in java?
What is re-factoring in software?
What do you mean by JVM?