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 |
I have a sorting issue with a Hashmap. My constraint is that I MUST use the Hashmap and work with existing code. I do a database query and place the results in a Hashmap. When I iterate thru the Hashmap, it loses the original alphabetical sorting done by the database. So, my problem is that I must sort the results coming out of the Hashmap which is then placed into another class.
C and C++ has constructors and distructors, why does Java does not have distructors?
Write java code to print "Hello how are you" Thread1 should have "Hello" Thread2 should have "how are you" both the threads should start at the same time
Which of these methods belong to Thread & Object class? join, yield, sleep, wait, notify
how can u handle run time exception in java? explain with brief explanation with examples?
Write a program to show whether a graph is a tree or not using adjacency matrix.
What is the difference between static synchronize() metod and synchronize() method?
What does java stand for?
What is tcp and udp?
What is not thread safe?
What is complexity in java?
How to sort numbers in java without array?