Hi friends i want display Triangle shap stars(*) please can
tell me any one java code logic?
*
***
*****
******* Like this
Answers were Sorted based on User's Feedback
Answer / sadikhasan palsaniya
public class Test{
public static void main(String var[]){
int c=1;
for(int i=1;i<=4;i++){
for(int k=4;k>=i;k--)
System.out.print(" ");
for(int j=1;j<=c;j++){
System.out.print("*");
}
System.out.println("");
c=c+2;
}
}
}
| Is This Answer Correct ? | 14 Yes | 5 No |
Explain how to convert any java object into byte array.
how to convert mm/dd/yy to dd/mm/yy using collections in java.
How many times garbage collector will invoke an object?s finalize() method?
is there a separate stack for each thread in java? : Java thread
How do you control extraneous variables?
3) Suppose you are a very rich person, having 50 rooms and you have lost the key for one of the room's. How effectively you can find this key? (Qs2 and Qs3 are related)
Is delete, next, main, exit or null keyword in java?
What are the elements of java?
which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None
What are the benefits of java?
What is a default constructor and also define copy contrucyor?
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?