Just IT: Java Entry Test

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Justittrainer
J
Justittrainer
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,366
| Attempts: 1,366 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which demonstrates inheritance?

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.

Submit
Please wait...
About This Quiz
Just IT: Java Entry Test - Quiz

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

2. Which two keywords directly support looping?

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.

Submit
3. Which two are true? (Choose two.)

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.

Submit
4. 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?

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 {

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

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.

Submit
6. Which are primitive data types?

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.

Submit
7. 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?

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.

Submit
8. Which ones are legal declarations?

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.

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

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.

Submit
10. 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.)

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.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 16, 2023 +

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
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which demonstrates inheritance?
Which two keywords directly support looping?
Which two are true? (Choose two.)
Given: ...
Which type of primitive can be assigned a new value within a...
Which are primitive data types?
You are asked to create code that defines a Beverage, and includes...
Which ones are legal declarations?
Which two are true about JavaScript and HTML? (Choose two.)
Given: ...
Alert!

Advertisement