HOW TO PRINT A NO IN WORDS USING WHILE LOOP THE NO WILL BE
PRINTED WHEN IT WILL BE IN THE RANGE BETWEEN 1 AND 3?



HOW TO PRINT A NO IN WORDS USING WHILE LOOP THE NO WILL BE PRINTED WHEN IT WILL BE IN THE RANGE BET..

Answer / jay harkhani

class WhileLoop
{
public static void main(String args[])
{
int i=1;
while(i!=4)
{
System.out.println("NO");
i++;
}
}
}

Is This Answer Correct ?    5 Yes 10 No

Post New Answer

More Core Java Interview Questions

Why Static variable required in java?For ex,class A { static int a; int b; } Why static is required?

5 Answers   Ericsson,


What is the use of static methods?

0 Answers  


What is java’s garbage collected heap?

0 Answers  


What are the files generated after using IDL to java compiler?

0 Answers  


What is the difference between sop and work instruction?

0 Answers  


Suppose i have two threads t1 and t2 are running.How the main thread will know that the two threads t1,t2 execution has completed?

2 Answers   Subex,


What is file class and what is its purpose?

1 Answers  


Why pointers are not used in java?

0 Answers  


Explain throw keyword in java?

0 Answers  


What is the function of log?

0 Answers  


I have one Shopping cart application, i that i have selected some items, while clicking submit button by mistake i have clicked twice or trice, that time items are selected twice or trice. Actually i want only one copy of items but its selected twice or trice. So how can we avoid this problem?

2 Answers   Honeywell,


Explain in detail about encapsulation with an example?

4 Answers  


Categories