• 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 is the value of a[1] after the following code is executed?int[] a = {0, 2, 4, 1, 3};for(int i = 0; i < a.length; i++) a[i] = a[(a[i] + 3) % a.length];

4
2
3
1
0

ANSWER DOWNLOAD EXAMIANS APP

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
2
1
0
None of these

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
Determine output:public class Test{ public static void main(String args[]){ int i, j; for(i=1, j=0;i<10;i++) j += i; System.out.println(i); }}

20
9
10
11
None of these

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
What is the printout of the following switch statement?char ch = 'a'; switch (ch){ case 'a': case 'A': System.out.print(ch); break; case 'b': case 'B': System.out.print(ch); break; case 'c': case 'C': System.out.print(ch); break; case 'd': case 'D': System.out.print(ch);}

ab
abcd
abc
a
aa

ANSWER DOWNLOAD EXAMIANS APP

JAVA Flow Control
What will be the result?1. int i = 10;2. while(i++ <= 10){3. i++;4. }5. System.out.print(i);

13
Line 5 will be never reached.
12
11
10

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"); } }}

FALSE
TRUE
Runtime Error
Compilation Error

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
↑