Predict the output of the given code.public class Demo
{public static void main(String args[]){ for(int i=1; i<2; i++) {
System.out.println(i); } }} *
2
12
1
123
Answers
Answered by
3
Answer:
I dont know java, but considering this in python
for(int i=1; i<2; i++)
System.out.println(i);
i=1 --> i<2 --> (1)
i=2 , and since i=2 it will not print any further messages
so the answer is most likely 1
Explanation:
It may also be 12 if im wrong
Answered by
0
Answer:
12
Explanation:
public
For the JRE to be able to access and use the main method, the access modifier must be set to public. Access to a method is restricted if it isn't made public.
Similar questions
History,
4 months ago
Social Sciences,
4 months ago
Math,
4 months ago
Math,
9 months ago
English,
1 year ago