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
What is nextline method in java?
What are the different types of methodologies?
What is an enumeration?
What are the basic control structures?
Can string be considered as a keyword?
What is class variable java?
What Is Composition?
What is a java lambda expression?
What is the difference between variable declaration and variable initialization?
What is size_t?
What are wrapped classes in java programming?
Can a constructor call the constructor of parent class?
What does opcode mean?
What do you mean by exception handling in Java?
What is the requirement of thread in java?