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
What is the hashcode () and equals () used for?
What is an empty class? What functionality does it offer in Java?
Differences between external iteration and internal iteration?
What does it mean that a class or member is final?
How to create a fecelet view?
What is canonical name in java?
Why singleton pattern is better than creating singleton class with static instance?
What does the “static” keyword mean?
Can a final variable be null?
Is an integer an object?
Can a static method be final?
Write a program to print count of empty strings in java 8?
What is close method? How it's different from Finalize & Dispose?
what are the methods in object?
What is the difference between a loader and a compiler?