• 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
In Java, the word true is ................

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

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. }

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

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
The following program:public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } }

Prints true
Will not compile as boolean is not initialized
Prints false
Will not compile as boolean can never be static

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

129
-127
2
None of these
Compiler error

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
What is the output for the below code ?1. public class Test{2. public static void main(String[] args){3. int i = 010;4. int j = 07;5. System.out.println(i);6. System.out.println(j);7. }8. }

Compilation fails with an error at line 3
Compilation fails with an error at line 5
10 7
None of these
8 7

ANSWER DOWNLOAD EXAMIANS APP

Data Types and Variables
Java is a ........... language.

None of these
moderate typed
strongly typed
weakly typed

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
↑