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 |
What do you understand by looping in java? Explain the different types of loops.
What are the uses of final, finally and finalize in java?
2 Answers Agiline, FINO PayTech, HCL,
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{
What is the statements?
What is a predicate method?
write the hierarchy of component class?
How will you convert an ArrayList to Arrays?
If set accepts only one argument then how can it compare two objects to avoid duplicates
What is mvc in java?
Explain Event handling in AWT?
why ,we are using jsp and html.which one is better?
How do you sort words in java?