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 exception hierarchy in java?
What does percent mean in java?
What is class variable java?
What is difference between static class and singleton pattern?
abstract class A{ int list []=new int [100]; A(int x,int y){ rondom n=new rondom(); for (int i==;i<100;i++); list [i]=x+r.next int(y-x+1); abstract sort (); abstract binary sarch(int temp); class B extends A{
When is the finally clause of a try-catch-finally statement executed?
What is casting?
what is the use of bean managed and container managed with example?
Difference between abstract class and Interfaces?
7 Answers CTS, iFlex, PA Consulting, Sai Softech, Value Chain,
program to find 25 square = 625 here the 625 of last two digits is equal to 25, i don't know excatly what this type of number is called
Difference in the use of print, println, and printf.
What is the new line character?