how to print the below in java?
* *
* *
*
* *
* *
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kickme
public static void main (String arg[]) {
System.out.println(" * * ");
System.out.println(" * * ");
System.out.println(" * ");
System.out.println(" * * ");
System.out.println(" * * ");
}
| Is This Answer Correct ? | 3 Yes | 1 No |
What is computer compiler?
What is final method?
How to change the priority of thread or how to set the priority of thread?
What are the override methods in Object class?
2 Answers Tech Mahindra, Wipro,
What is the final class?
How many bits is a double?
What is the return type of readLine() when end of a file is reached?
What is a numeric format?
JVM is platform independent or depeneded?
What is Mutex (Mutual Exclusion Object) ?
Can java object be locked down for exclusive use by a given thread?
what are the analysis of an object