• HOME
  • QUIZ
  • CONTACT US
EXAMIANS
  • COMPUTER
  • CURRENT AFFAIRS
  • ENGINEERING
    • Chemical Engineering
    • Civil Engineering
    • Computer Engineering
    • Electrical Engineering
    • Mechanical Engineering
  • ENGLISH GRAMMAR
  • GK
  • GUJARATI MCQ

JAVA Flow Control

JAVA Flow Control
What will be the output?public class Test{ public static void main(String args[]){ int i = 1; do{ i--; }while(i > 2); System.out.println(i); }}

1
0
-1
2
None of these

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
Which of the following for loops will be an infinite loop?

for(i=0 ; i<1; i--)
for(; ;)
All of these
for(i=0; ; i++)

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
What will be the result of compiling and runnig the following code:public class Test{ public static void main(String... args) throws Exception{ Integer i = 34; int l = 34; if(i.equals(l)){ System.out.println("true"); }else{ System.out.println("false"); } }}

true
None of these
Compiler error
false

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
How many times will the following code print "Welcome to Examveda"?int count = 0;do { System.out.println("Welcome to Examveda"); count++;} while (count < 10);

10
9
0
11
8

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
What will be the output of the following program?public class Test{ public static void main(String args[]){ int i = 0, j = 5 ; for( ; (i < 3) && (j++ < 10) ; i++ ){ System.out.print(" " + i + " " + j ); } System.out.print(" " + i + " " + j ); }}

0 6 1 7 2 8 3 8
0 6 1 7 2 8 3 9
Compilation Error
0 6 1 5 2 5 3 5

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
What will be the output?public class Test{ public static void main(String[] args){ int x=10, y=0; if(x && y){ System.out.print("TRUE"); } else{ System.out.print("FALSE"); } }}

Runtime Error
Compilation Error
FALSE
TRUE

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON JAVA Flow Control

DOWNLOAD APP

  • APPLE
    from app store
  • ANDROID
    from play store

SEARCH

LOGIN HERE


  • GOOGLE

FIND US

  • 1.70K
    FOLLOW US
  • EXAMIANSSTUDY FOR YOUR DREAMS.
  • SUPPORT :SUPPORT EMAIL ACCOUNT : examians@yahoo.com

OTHER WEBSITES

  • GUJARATI MCQ
  • ACCOUNTIANS

QUICK LINKS

  • HOME
  • QUIZ
  • PRIVACY POLICY
  • DISCLAIMER
  • TERMS & CONDITIONS
  • CONTACT US
↑