Java Fundamentals for Android Development Quiz Questions and Answers

Answer :
  • nothing - this will not compile.

Explanation :

The int type in Java can be used to represent any whole number from -2147483648 to 2147483647. Therefore this code will not compile as the number assigned to 'a' is larger than the int type can hold.
Answer :
  • "123 "

Explanation :

The answer is "123 ". The abs() method evaluates to the one inside mypackage.Math class.
Answer :
  • It will not compile because of line 10.

Explanation :

Non-static method message() cannot be referenced from a static context.
Answer :
  • Getters and setters can speed up compilation
Answer :
  • When an object is created from a class using the new keyword
Answer :
  • Hiding the data and implementation details within a class
Answer :
  • It will print "Hello World! " three times
Answer :
  • truetrue
Answer :
  • Inside the method