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 |
Can you use abstract and final both with a method?
How to do a true java ping from windows?
What is meant by Session? Explain something about HTTP Session Class?
What does file separator do in java?
did interface can implementation method ? i know its not possible but my interviewer said its possible ..but how..? any one have idea ???
What is string in java is it a data type?
What do you mean by an object in java?
Is ++ operator is thread safe in java?
What do you understand by a Static Variable?
How many java versions are there?
What are default methods ?
how to transactions(Bank transactions) in business process in ejb?