GoConqr has a new look! Let us know what you think.

Quiz

Starter Test Rough Spots

myc elium 44 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (44)

  1. 1You can change 'this' in classes
    [EX: this = new Class();]
    1. ATrue
    2. BFalse
  2. 2Select the correct methods/constructors for Random + correct explanations for each
    1. ARandom() creates a new random number generator that has no seed
    2. BRandom(long num) creates a new random number generator with num as its seed
    3. CRandom(long num) creates a new random number generator with 0 as its lower bound [inclusive] and num as its upper bound [exclusive] for range
    4. DRandom(long num1, long num2) creates a new random number generator with num1 as its lower bound [inclusive] and num2 as its upper bound [exclusive] for range
    5. EsetSeed(long num) is needed to set the seed of a Random object
    6. FRandom() creates a new random number generator that has the current system time as the seed
    7. GWe get a randomly generated int by calling nextInt() on a Random object
    8. HWe get a randomly generated number by calling generate() on a Random object
    9. InextInt(int num) returns a random number between 0 [inclusive] and num [exclusive]
    10. Jgenerate(int num) returns a random number between 0 [inclusive] and num [exclusive]
  3. 3Methods and variables can have the same name as the class they're in
    1. ATrue
    2. BFalse
  4. 4Select the valid null reference declaration
    1. AFile f = null;
    2. BDate d(null);
    3. CObject obj = NULL;
    4. DString str : null;
  5. 5Java will define a default constructor for every class, even if it already has a parameterized constructor
    1. ATrue
    2. BFalse
  6. 6Java will construct a default constructor ONLY if the class doesn't define any explicitly
    1. ATrue
    2. BFalse
  7. 7What will happen if we try to run the following for loop?
    for (int i=0; ; i++) break;
    1. AThe loop runs once and stops due to the break statement. i will not increment, as the break statement is before it could.
    2. BThe code will fail to compile
    3. CThe loop runs once and stops due to the break statement. i will increment, as i++ is called before break
  8. 8What is the default access modifier for methods and variables?
    1. Apackage-private
    2. Bprivate
    3. Cprotected
    4. Dpublic
  9. 9What does the package-private access modifier do?
    1. AClasses in the same package can access that method/variable
    2. BOnly the class itself can access that method/variable
    3. CClasses in the same folder can access that method/variable
  10. 10Main can return something other than void
    1. ATrue
    2. BFalse

Information

Description
Full Stack Development OCL Java 8 Foundations Exam Quiz on Starter Test Rough Spots, created by myc elium on 30/11/2025.
Author
myc elium
Language
English
Views
5
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?