Quiz_ToDay



This content originally appeared on DEV Community and was authored by Ajay Raja

TodayClass

Today’s Class our Trainer gave some MCQ questions in Java.Some basic java questions.
Questions for my future reference:

  1. What is the range of short data type in Java?
  2. What is the range of byte data type in Java?
  3. Which of the following are legal lines of Java code?   1. int w = (int)888.8;    2. byte x = (byte)100L;    3. long y = (byte)100;    4. byte z = (byte)100L;
  4. Which of the following is not true about Java?
  5. Which of these coding types is used for data type characters in Java?
  6. What is the default value of boolean literal?
  7. Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
  8. Which one is a valid declaration of a boolean?
  9. Which of these is long data type literal?
  10. Which of these can be returned by the operator &&?
  11. Long literal should be suffixed with ?
  12. Floating point literal should be suffixed with?
  13. Which of these cannot be used for a variable name in Java?
  14. JDK is platform dependent ?
  15. JRM is inside JVM ?
  16. Java is case in-sensitive language ?
  17. Python is derived from java ?
  18. Java is 25 times faster than Python in 1995 ? 19.Java is derived from C++ ?
  19. What is type conversions in Java ? Match the following
  20. James Gosling – a) Write Once Run Anywhere
  21. Cup and saucer – b) 23-May-1995
  22. Java slogan – c) Father of Java
  23. Java DOB – d) Oracle
  24. Java current owner – e) Symbol of Java Answers:

1)-32768 to 32767
2)-128 to 127
3)All statements are correct
4)4th generation language
5)UNICODE
6)false
7)ASCII
8)boolean b3 = false;
9)9967124623L
10)Boolean
11)L or l
12)F or f
13)keyword
14)true (JDK tools are platform dependent, but Java itself is platform independent)
15)false (JRE contains JVM, not inside JVM)
16)false (Java is case sensitive)
17)false
18)true (Java was designed to be much faster than interpreted languages like Python)
19)true (Syntax influenced by C++)
20)Both type casting and type promotion
These are some of the answers for my future reference so i made like blog.


This content originally appeared on DEV Community and was authored by Ajay Raja