Just IT: Java Entry Test

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Justittrainer
J
Justittrainer
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,360
Questions: 10 | Attempts: 1,360

SettingsSettingsSettings
Just IT: Java Entry Test - Quiz

3. This test will assess your suitability for our program. The pass score is 50%.


Questions and Answers
  • 1. 

    Which two keywords directly support looping?

    • A.

      If

    • B.

      For

    • C.

      While

    • D.

      Switch

    • E.

      Foreach

    Correct Answer(s)
    B. For
    C. While
    Explanation
    The keywords "for" and "while" directly support looping. The "for" keyword is used for creating a loop that executes a block of code a specified number of times. It consists of an initialization, a condition, and an increment or decrement statement. The "while" keyword is used for creating a loop that executes a block of code as long as a specified condition is true. It only requires a condition to be evaluated.

    Rate this question:

  • 2. 

    Which are primitive data types?

    • A.

      Int

    • B.

      Integer

    • C.

      String

    • D.

      Long

    • E.

      Boolean

    Correct Answer(s)
    A. Int
    D. Long
    E. Boolean
    Explanation
    The primitive data types in this question are int, long, and boolean. These data types are considered primitive because they are the most basic and fundamental data types in programming. They are not objects and do not have any methods or properties associated with them. Int and long are used to represent whole numbers, while boolean is used to represent true or false values. String, on the other hand, is not a primitive data type as it is an object that represents a sequence of characters.

    Rate this question:

  • 3. 

    Given: 1. public interface Player { 2. // insert code here 3. // insert code here 4. } 5. class F implements Player { 6. public void play(){ 7. // ... 8. } 9. public void stop(){ 10. // ... 11. } 12. } Which two, inserted independently at lines 2 and 3, allow the code to compile? (Choose two.)

    • A.

      Void play (); int stop ();

    • B.

      Void play (); void stop();

    • C.

      Static void play (); static void stop();

    • D.

      Public void play (); public void stop();

    • E.

      Private void play (); private void stop();

    Correct Answer(s)
    B. Void play (); void stop();
    D. Public void play (); public void stop();
    Explanation
    The correct answer is "void play (); void stop();,public void play (); public void stop();". These two options allow the code to compile because they correctly implement the methods specified in the Player interface. The interface requires the implementation of a play() method and a stop() method, so inserting these two options at lines 2 and 3 would satisfy this requirement.

    Rate this question:

  • 4. 

    You are asked to create code that defines a Beverage, and includes method implementation code for some beverage behaviors. Beverage subtypes will be required to provide implementations of some, but not all, of the methods defined in Beverage. Which approach correctly implements these goals?

    • A.

      Create an abstract Beverage class that defines only abstract methods.

    • B.

      Create a Beverage interface that all beverage subtypes must implement.

    • C.

      Create a concrete Beverage class that defines both abstract and concrete methods.

    • D.

      Create an abstract Beverage class that defines both abstract and concrete methods.

    Correct Answer
    D. Create an abstract Beverage class that defines both abstract and concrete methods.
    Explanation
    The correct answer is to create an abstract Beverage class that defines both abstract and concrete methods. This approach allows for the creation of a base class that provides some default behavior for the beverage, while also allowing subclasses to override and provide their own implementation for specific methods. This provides flexibility and reusability in the code, as different beverage subtypes can share common behavior while also having the ability to customize certain methods as needed.

    Rate this question:

  • 5. 

    Given: 1. // insert code here 2. void play(); 3. void stop(); 4. } 5. // insert code here 6. public void play() { } 7. public void stop() { } 8. } Which, inserted at lines 1 and 5, allows the code to compile?

    • A.

      1. interface Player { 5. class DVDPlayer implements Player {

    • B.

      1. implements Player { 5. class DVDPlayer interface Player {

    • C.

      1. class Player { 5. interface DVDPlayer implements Player {

    • D.

      1. interface Player { 5. class DVDPlayer extends Player {

    • E.

      1. abstract class Player { 5. class DVDPlayer extends Player {

    Correct Answer
    A. 1. interface Player { 5. class DVDPlayer implements Player {
    Explanation
    The code snippet provided is defining a class named "DVDPlayer" that implements the "Player" interface. In order for the code to compile, the class "DVDPlayer" needs to implement all the methods declared in the "Player" interface. Therefore, the correct answer is 1. interface Player { 5. class DVDPlayer implements Player {

    Rate this question:

  • 6. 

    Which two are true? (Choose two.)

    • A.

      An interface can implement another interface.

    • B.

      A class can implement more than one interface.

    • C.

      Many classes can implement the same interface.

    • D.

      Every class must implement at least one interface.

    Correct Answer(s)
    B. A class can implement more than one interface.
    C. Many classes can implement the same interface.
    Explanation
    A class can implement more than one interface because interfaces provide a way for a class to define multiple contracts or behaviors that it can adhere to. This allows a class to inherit and implement the methods and properties of multiple interfaces simultaneously.Many classes can implement the same interface because interfaces define a contract or a set of methods and properties that a class must implement. Multiple classes can implement the same interface, each providing their own implementation of the methods and properties defined in the interface. This allows for code reusability and polymorphism.

    Rate this question:

  • 7. 

    Which two are true about JavaScript and HTML? (Choose two.)

    • A.

      JavaScript is part of the J2SE.

    • B.

      JavaScript and HTML are NOT compiled.

    • C.

      JavaScript provides more client-side functionality than HTML alone.

    • D.

      JavaScript code is always processed on the server, NOT on the client.

    • E.

      JavaScript is guaranteed to be portable across all browsers on any platform.

    Correct Answer(s)
    B. JavaScript and HTML are NOT compiled.
    C. JavaScript provides more client-side functionality than HTML alone.
    Explanation
    JavaScript and HTML are not compiled, meaning they are not converted into machine code before execution. Instead, they are interpreted by the browser at runtime. JavaScript provides more client-side functionality than HTML alone, as it allows for dynamic content, interactivity, and manipulation of web page elements.

    Rate this question:

  • 8. 

    Which ones are legal declarations?

    • A.

      String st = null;

    • B.

      String st = "Hello";

    • C.

      String st = 'Hello';

    • D.

      String st =="Hello";

    • E.

      String st = new String ("Hello");

    Correct Answer(s)
    A. String st = null;
    B. String st = "Hello";
    E. String st = new String ("Hello");
    Explanation
    The correct answer options are all legal declarations of a string variable.
    - "String st = null;" is a valid declaration where the variable "st" is assigned a null value.
    - "String st = 'Hello';" is an incorrect declaration as single quotes should not be used for string literals.
    - "String st =="Hello";" is an incorrect declaration as it uses double equal signs instead of a single equal sign for assignment.
    - "String st = new String ("Hello");" is a valid declaration where a new instance of the String class is created using the constructor.

    Rate this question:

  • 9. 

    Which type of primitive can be assigned a new value within a conditional expression?

    • A.

      Int

    • B.

      Short

    • C.

      Byte

    • D.

      Boolean

    • E.

      Char

    Correct Answer
    D. Boolean
    Explanation
    A boolean is the only primitive type that can be assigned a new value within a conditional expression. This is because a conditional expression evaluates to a boolean value (true or false), and therefore a boolean variable can be assigned the result of the evaluation. In contrast, the other primitive types (int, short, byte, and char) cannot be assigned a new value within a conditional expression as they do not directly represent boolean values.

    Rate this question:

  • 10. 

    Which demonstrates inheritance?

    • A.

      Class A this B { }

    • B.

      Class A super B { }

    • C.

      Class A extends B { }

    • D.

      Class A implements B { }

    Correct Answer
    C. Class A extends B { }
    Explanation
    The correct answer is "class A extends B { }". This demonstrates inheritance because the class A is extending the class B, which means that class A will inherit all the properties and methods of class B. This allows class A to reuse the code from class B and add additional functionality if needed.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 16, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 16, 2009
    Quiz Created by
    Justittrainer
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.