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 |
Can a constructor be made final?
What are variable names?
Is integer immutable in java?
What is an infinite loop?
What are instance variables?
Which oo concept is achieved by using overloading and overriding?
How can we access some class in another class in java?
What is the difference between Synchronizing mehtod & Synchronizing block?
Why is logger singleton?
Nullpointer exception is a very common exception. Why is it not made as a checked exception?
Is string is a data type?
What is the specification of ?CODEBASE? in an applet?