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 collatration?
What is an i/o filter?
Is an object null?
Can we create constructor in abstract class ?
Can you explain the meaning of aggregation and composition
Do you need to import math in java?
How is it possible for two string objects with identical values not to be equal under the == operator?
what are the major differences between jdk1.4 and jdk1.5?
2 Answers Cap Gemini, Crimson Logic, Infosys, TCS, Tenth Planet,
What is ternary operator? Give an example.
How does thread synchronization occurs inside a monitor?
What is the abstraction?
What is the difference between preemptive scheduling and time slicing in java programming?