how to print a numbers from 1 to 100 with out using control
structures?
Answer Posted / sushila
public class Arr
{
static int a[]=new int[100];
static int i=0;
public static void main(String args[])
{
try
{
i=add(i);
a[i]=i;
main(args);
}
catch(ArrayIndexOutOfBoundsException e){
}
}
static int add(int i)
{
System.out.println(++i);
return ++i;
}
}
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Can we use string in the switch case?
What is boolean strategy?
What is return keyword in java?
Explain the meaning of java applet.
Explain the transient field modifier?
What is entry set in java?
What is flag in java?
Explain how can you debug the Java code?
what is static import in java? Explain
Explain the difference between static and dynamic binding in java?
What is use of inner class in java?
What is the difference between and ?
Is array passed by reference in java?
Why is it called buffering?
What does exclamation mean in java?