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

Data Types and Variables

Data Types and Variables
What will the output of the following program?public class Test{ public static void main(String args[]){ float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }}

3
2.5
0
25
2

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
What will be the output for the below code ?1. public class Test{2. int i=8;3. int j=9;4. public static void main(String[] args){5. add();6. }7. public static void add(){8. int k = i+j;9. System.out.println(k);10. }11. }

Compilation fails with an error at line 8
17
None of these
Compilation fails with an error at line 5
0

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
Which of the following automatic type conversion will be possible?

long to int
short to int
int to long
byte to int

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
Determine output:public class Test{int i = 34;public static void main(String args[]){Test t1 = new Test();Test t2 = new Test();t1.i = 65;System.out.print(t1.i);System.out.print(t2.i);}}

65 65
34 34
65 34
34 65

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
In Java, the word true is ................

Same as value 1
Same as value 0
A Boolean literal
A Java keyword

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
What will be output of following program?public class Test{ public static void main(String[] args){ byte b=127; b++; b++; System.out.println(b); }}

None of these
-127
2
129
Compiler error

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON Data Types and Variables

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
↑