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 |
explain what is transient variable in java?
How much is a java license?
Explain different forms of polymorphism?
define System.out.println(); what is the meaning!
Java.util.regex consists of which classes?
what is an virtual function
Is it safe for adding 10,00,000 records/objects to HashMap?, i.e is it safe to add millions of objects to HashMap?
String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects
What are the latest versions in JAVA related areas?
What is included in core java?
Is java util list serializable?
How do you define a set in java?