Hi friends i want display Triangle shap stars(*) please can
tell me any one java code logic?
*
***
*****
******* Like this
Answer Posted / 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 |
Post New Answer View All Answers
What are Normalization Rules? Define Normalization?
What is the basic difference between string and stringbuffer object?
Which class is used by server applications to obtain a port and listen for client requests?
Can we have try block without catch block?
List the features of java programming language.
What is unicode datatype?
Distinguish between a predicate and a function?
What is the implementation of destroy method in java. Is it native or java code?
What is multithreading and its advantages?
What is an example of procedure?
what is nested class in java?
How can a gui component handle its own events?
List some java keywords sun like c, c + + keywords?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
What is the hashcode () and equals () used for?