Вы находитесь на странице: 1из 35

Pertanyaan 1 30 detik

Q. An object may interact with another object by invoking methods.


Pilihan jawaban
True (*)
False

Pertanyaan 2 30 detik
Q. Which of the following language is called a procedural language?
Pilihan jawaban
C++
Java
C (*)
Java C

Pertanyaan 3 30 detik
Q. You design a Circle class with various fields and methods. Which of the following could be fields in
this class? Distinguish which of these are between the properties and behavior.
Pilihan jawaban
calculateDiameter()
color (*)
calculateArea()
radius (*)
calculateCircumference()

Pertanyaan 4 30 detik
Q. In object oriented programming, an object comprises of properties and behaviors where properties
represented as fields of the object and behavior is represented as method.
Pilihan jawaban
True (*)
False

Pertanyaan 5 30 detik
Q. In object oriented programming, there is an emphasis on which of the following two:
Pilihan jawaban
Writing algorithms.
Creation of procedures.
Modeling objects. (*)
Object interaction without a prescribed order. (*)

Pertanyaan 6 30 detik
Q.
You can set any number of breakpoints for your program.
Pilihan jawaban
True (*)
False

Pertanyaan 7 30 detik
Q. When the program runs normally (when not in debug mode), which statement is true about
breakpoints?
Pilihan jawaban
Breakpoints will not have any effect on program execution. (*)
Breakpoints will stop program execution at the first breakpoint.
Breakpoints will stop program execution at the last breakpoint.
Any Breakpoint will stop program execution.

Pertanyaan 8 30 detik
Q. Which of the following three statements are true about breakpoint?
Pilihan jawaban
They help with debugging. (*)
They pause code execution. (*)
They insert break statements.
They can be used to check the current state of the program (*)
They abruptly ends the code execution.

Pertanyaan 9 30 detik
Q. Which of the following are considered Whitespace?
(Choose all correct answers)

Pilihan jawaban
Space in the print statements.
Space between the [ ] braces.
Indentation before the code. (*)
Blank lines in the code. (*)
Space between words. (*)

Pertanyaan 10 30 detik
Q. Which of the following two features are supported by the NetBeans IDE.
Pilihan jawaban
NetBeans highlights matching braces. (*)
NetBeans automatically runs the program once all the braces in the code are matched.
Once NetBeans spots a problem, it won’t allow you to continue coding until the problem is fixed.
NetBeans provides a shortcut to format whitespace. (*)
Pertanyaan 11 30 detik
Q. Which of the following 2 statements are true about whitespace?
Pilihan jawaban
Whitespace increases execution time of your program.
Whitespace eliminates typing mistakes while programming.
Whitespace reduces the performance of the program.
Whitespace makes your code more readable (*)
Whitespace helps to keep your code organized. (*)

Pertanyaan 12 30 detik
Q. A software feature may allow the user to perform a specific task.
Pilihan jawaban
True (*)
False

Pertanyaan 13 30 detik
Q. If the requirement step of the Spiral Model of development is forgotten, which of the following could
occur?
Pilihan jawaban
Code becomes messy.
Solutions seem elusive.
The Program gives inaccurate results.
Required software features are missing from the program. (*)

Pertanyaan 14 30 detik
Q. The Spiral Model reflects an iterative development process.
Pilihan jawaban
True (*)
False

Pertanyaan 15 30 detik
Q. You’d like to see a movie with a few friends. You write an email to confirm plans.

Hi Friends,

There’s a new movie “Attack of the Duke!” premiering this Friday at Oracle Cinema at 4:30 PM. The
cinema is at the corner of South Street and Walnut Ave. Subway would be the best way to get there.

Would any of you be interested in going?


Which of the following are requirements for this plan?

Pilihan jawaban
Watch “Attack of the Duke!” on Friday at Oracle Cinema at 4:30 PM. (*)
Reach the cinema by 4:00 PM.
Travel via subway.
Double check the location by verifying you’re on South Street and Walnut Ave.

Pertanyaan 16 30 detik
Q. What is the correct order of steps in the Spiral Model of Development?
Pilihan jawaban
Design, Requirements, Develop, Test
Requirements, Design, Test, Develop
Design, Develop , Requirements, Test
Requirements, Design, Develop, Test (*)

Pertanyaan 17 30 detik
Q. During the Design phase of software development, the programmer implements features gathered
during the Requirement phase.
Pilihan jawaban
True
False (*)

Pertanyaan 18 30 detik
Q. You have a beautiful garden at home. On Sunday, you start budding your rose plant to make few
more samples of rose plants to plant in the garden.

Can you categorize how this scenario could be represented by classes and instances?

Pilihan jawaban
Samples of the rose plant are called classes and not the actual rose plant.

Samples are the class and the rose plant is the instances of samples.

Rose plant is the object and samples are not instances of the plant because they have not grown yet.

Rose plant is the class and the samples generated from the rose plant are instances of that class. (*)
Pertanyaan 19 30 detik
Q. There are several fields and methods in a Shirt class. Which of the following could be a method in the
Shirt class?
Pilihan jawaban
size

getShirtSize()(*)

color

price

Pertanyaan 20 30 detik
Q. Java mostly reads code line-by-line.
Pilihan jawaban
True (*)

False

Pertanyaan 21 30 detik
Q. Which two are the correct syntax for adding comments?
Pilihan jawaban
Start with a slash- star (/*). End with slash-star (/*).

Start with two slashes and a star (//*). End with a star-slash (*/).

Start with a slash-star (/*). End with a star-slash (*/). (*)

Start with two slashes (//). End with two slashes (//).(*)

Start with two slashes (//). End when the line ends.

Pertanyaan 22 30 detik
Q. A Java program can be written in the single line.
Pilihan jawaban
True (*)

False

Pertanyaan 23 30 detik
Q. What is the purpose of adding comments in the code?
Pilihan jawaban
Provide an explanation about the code to the programmer. (*)

To provide better security to the program.

It increases the execution time of the code.

Provide good look and feel of the code.

Pertanyaan 24 30 detik
Q. Code within curly braces is called a “Block of code”.
Pilihan jawaban
True (*)

False

Pertanyaan 25 30 detik
Q. Java is a strongly typed language; therefore you must declare a data type for all variables.
Pilihan jawaban
True (*)

False

Pertanyaan 26 30 detik
Q. Which is valid syntax to declare and initialize a String variable?
Pilihan jawaban
String x= “Java”; (*)

String x = Java;

String “x” = Java;

String “x” = “Java”;

Pertanyaan 27 30 detik
Q. Which two data types are appropriate for their variable?
Pilihan jawaban
double checkingAmount = 1500; (*)

boolean age = 20;

int averageDollarAmount = 19.95;


String firstName = “Alex”; (*)

Pertanyaan 28 30 detik
Q. Which two statements will not compile?
Pilihan jawaban
double double=10; (*)

int age=20;

int break=10; (*)

double salary = 20000.34;

int abc = 10;

Pertanyaan 29 30 detik
Q. Which two are valid?
Pilihan jawaban
double doubleVar1; doubleVar2 = 3.1.

double doubleVar1, doubleVar2 = 3.1; (*)

double doubleVar1 = 3.1; double doubleVar2 = 3.1; (*)

double doubleVar1, double doubleVar2 = 3.1;

Pertanyaan 30 30 detik
Q. Assigning a value to the variable is called “initialization”.
Pilihan jawaban
True (*)

False

Pertanyaan 31 30 detik
Q. Identify the variable declared in the given code.
Pilihan jawaban
a (*)

Welcome

2
int

Pertanyaan 32 30 detik
Q.
How many bits are in a byte?

Pilihan jawaban
2

8 (*)

Pertanyaan 33 30 detik
Q. Which two are mathematical operators?
Pilihan jawaban
+ (*)

- (*)

Pertanyaan 34 30 detik
Q. Which keyword makes a variable’s value unchangeable?
Pilihan jawaban
const

final (*)

static

break

Pertanyaan 35 30 detik
Q. Which two are recommended practices for naming final variables?
Pilihan jawaban
Capitalize every letter (*)

Separate words with an underscore (*)

Capitalize first letter

Separate words with an space

Pertanyaan 36 30 detik
Q. This declaration represents a long data type.
long a = 123L;

Pilihan jawaban
True (*)

False

Pertanyaan 37 30 detik
Q. What value is assigned to x?

int x = 25 - 5 * 4 / 2 - 10 + 4;

Pilihan jawaban
8

9 (*)

34

Pertanyaan 38 30 detik
Q. Which of the following data types is the largest?
Pilihan jawaban
byte

short

int

long (*)
Pertanyaan 39 30 detik
Q. What is the output?
Pilihan jawaban
Value of age: 20 (*)
Value of age: 8
Value of age: 10

Value of age: 20

Value of age: 28

Value of age: 38

Value of age: 20

Value of age: 208

Value of age: 20810

Value of age: 20

Value of age: 8

Value of age: 9

Pertanyaan 40 30 detik
Q. Which of the following two statements are true about variables?
Pilihan jawaban
Variables will be ignored by compiler.

The value assigned to a variable may never change.

They allow code to be edited more efficiently. (*)

They make code becomes flexible. (*)

Pertanyaan 41 30 detik
Q. Which two are valid assignments of a?
Pilihan jawaban
int a = 10
int a; a = 10; (*)

int a = “10”;

int a = 10; (*)

Pertanyaan 42 30 detik
Q. Identify the names of two variables used in the given code.
Pilihan jawaban
strVal (*)

Hello

int

String

intVal (*)

Pertanyaan 43 30 detik
Q. What is the output?
Pilihan jawaban
World (*)

Hello

Hello World

Hello

World

Pertanyaan 44 30 detik
Q. Which data type is most commonly used to represent numeric data?
Pilihan jawaban
Int (*)

float

String

short
Pertanyaan 45 30 detik
Q. Assuming x is an int, which of the following are ways to increment the value of x by 1?

(Choose all correct answers)

Pilihan jawaban
x = x +1; (*)

x = +1;

x+;

x++; (*)

x += 1; (*)

Pertanyaan 46 30 detik
Q.
Pilihan jawaban
Value of x is 0

Value of y is 1

Value of x is 100

Value of y is 1

Value of x is 100

Value of y is 1

Value of x is 100 (*)


Value of y is 101

Pertanyaan 47 30 detik
Q. What is the correct way to cast a long to an int?
Pilihan jawaban
int longToInt = int 20L;

int longToInt = (int)20L; (*)


int longToInt = 20L(int);

int longToInt = 20L;

Pertanyaan 48 30 detik
Q. Which two statements are true about type casting?
Pilihan jawaban
Type casting retains the size of the value or the original data type.

Type casting cannot be performed on equations.

Type casting lowers the range of possible values. (*)

Type casting changes the type of the value stored. (*)

Pertanyaan 49 30 detik
Q. Which is a valid way to parse a String as an int?
Pilihan jawaban
int intVar1 = (int)"100";

int intVar1 = "100";

int intVar1 = Integer.parseInt("100"); (*)

int intVar1 = Integer.parseInt("One Hundred");

Pertanyaan 50 30 detik
Q. A double with the value of 20.5 is cast to an int. What is the value of the int?
Pilihan jawaban
21

25

20 (*)

20.5

Pertanyaan 51 30 detik
Q. A short data type can be promoted to which of the following types?
(Choose all correct answers)
Pilihan jawaban
boolean

byte

long (*)

double (*)

int (*)

Pertanyaan 52 30 detik
Q. When the result of an expression is assigned to a temporary memory location, what is the size of
memory allocated?
Pilihan jawaban
The size of the smallest data type used in the expression.

A default size is allocated.

The size of the any data type used in the expression.

The size of the largest data type used in the expression. (*)

Pertanyaan 53 30 detik
Q. Double quotes may be used with char literal values.
Pilihan jawaban
True

False(*)
Pertanyaan 54 30 detik
Q. An Object cannot have String objects as properties.
Pilihan jawaban
True

False (*)

Pertanyaan 55 30 detik
Q. What is the output?
Pilihan jawaban
Hello World

“Hello” “World” “2016” “!”


“Hello World 2016”

Hello World 2016 ! (*)

Pertanyaan 56 30 detik
Q. The print() method prints to the console and automatically creates a line.
Pilihan jawaban
True

False(*)
Pertanyaan 57 30 detik
Q. Which two statements are true about String concatenation.
Pilihan jawaban
String concatenation cannot be done with numbers.

Strings can be combined using the ‘+’ operator (*)

String concatenation can be done with String variables and String Literals. (*)

String concatenation cannot be done with more than two String Literals.

Pertanyaan 58 30 detik
Q. These two code fragments perform the same task.
Pilihan jawaban
True (*)

False

Pertanyaan 59 30 detik
Q. System.in readies Scanner to collect input from the console.
Pilihan jawaban
True (*)

False

Pertanyaan 60 30 detik
Q. It's best-practice to close the Scanner stream when finished
Pilihan jawaban
True (*)

False
Pertanyaan 61 30 detik
Q. A String can be created by combining multiple String Literals.
Pilihan jawaban
True (*)

False

Pertanyaan 62 30 detik
Q. The Java compiler automatically promotes byte, short, and chars data type values to int data type.
Pilihan jawaban
True (*)

False

Pertanyaan 63 30 detik
Q. What is parsing?
Pilihan jawaban
Converting numeric data to a specified numeric data type

Converting numeric data to text

Converting text to numeric data (*)

Reading text from numeric data

Pertanyaan 64 30 detik
Q. Automatic promotion from smaller data type to a larger data type is not allowed in Java.
Pilihan jawaban
True

False (*)

Pertanyaan 65 30 detik
Q. Given the expression:

String message = ”Hello World”;

Which is the String Literal?


Pilihan jawaban
String message = ”Hello World”;

message

String message

Hello World (*)

Pertanyaan 66 30 detik
Q. Which is the correct declaration for a char data type?
Pilihan jawaban
char size = ’M’; (*)

char size = ’Medium’;

char size = “Medium”;

char size = “M”;

Pertanyaan 67 30 detik
Q. char is the primitive textual data type in Java.
Pilihan jawaban
True (*)

False

Pertanyaan 68 30 detik
Q. In Java, char is a primitive data type, while String is an object data type.
Pilihan jawaban
True (*)

False

Pertanyaan 69 30 detik
Q. Which two statements are true about the Scanner class?
Pilihan jawaban
A Scanner object doesn’t have fields and methods.

A Scanner object opens a stream for collecting input. (*)


A Scanner’s delimiter can be changed. (*)

Scanners cannot read text files.

Pertanyaan 70 30 detik
Q. You write a statement that assigns a value to a String variable as shown below.

String input = ”This is Java Program”;

This way of assigning values to variables is known as hard-coding.

Pilihan jawaban
True (*)

False

Pertanyaan 71 30 detik
Q. Given the import statement:
import java.awt.font.TextLayout;

which is the package name?

Pilihan jawaban
java.awt.font (*)

java.awt

java

awt.font

Pertanyaan 72 30 detik
Q. The classes of the Java class library are organized into packages.
Pilihan jawaban
True (*)

False

Pertanyaan 73 30 detik
Q. The JFrame and JOptionPane classes are in the javax.swing package. Which two will import those
classes?
Pilihan jawaban
import javax.swing.*; (*)

import javax.swing.J*;

import javax.swing.JOptionPane; (*)


import javax.swing.JFrame;

import javax.swing;

Pertanyaan 74 30 detik
Q. Which statement is true about packages?
Pilihan jawaban
A package makes it difficult to locate the related classes.

A package contains a group of related classes. (*)

Packages of the Java class library do not contain related classes.

A package doesn’t contain a group of related classes.

Pertanyaan 75 30 detik
Q. Which of the following wild card character is used to import all the classes in a particular package?
Pilihan jawaban
;

* (*)

Pertanyaan 76 30 detik
Q. Import statements are placed above the class definition.
Pilihan jawaban
True (*)

False

Pertanyaan 77 30 detik
Q. Which package is implicitly imported?
Pilihan jawaban
java.lang (*)

java.math

java.awt

java.io

Pertanyaan 78 30 detik
Q. Which of the following are the arguments in the following method?

Employee emp = new Employee();

emp.calculateSalary(100000, 3.2, 15);

Pilihan jawaban
emp.calculateSalary(100000, 3.2, 15);

calculateSalary(100000, 3.2, 15); (*)

emp

100000, 3.2, 15

Pertanyaan 79 30 detik
Q. How many arguments does the following method accept?
Pilihan jawaban
1

3 (*)

Pertanyaan 80 30 detik
Q. Object instantiation is done using what keyword?
Pilihan jawaban
void
instance

System

New (*)

Pertanyaan 81 30 detik
Q. Which of the following statements are true?
(Choose all correct answers)

Pilihan jawaban
Methods cannot be written with parameters.

Parameter values can never be used within the method code block.

Methods can be written with any number of parameters. (*)

Methods can never be written with more than four parameters.

Parameter values can be used within the method code block. (*)

Pertanyaan 82 30 detik
Q. void type methods don’t return any values
Pilihan jawaban
True (*)

False

Pertanyaan 83 30 detik
Q. You’re designing banking software and need to store 10000 customer accounts with information on
the accountholder’s name, balance, and interest rate. The best approach is store 30000 separate
variables in the main method.
Pilihan jawaban
True

False (*)

Pertanyaan 84 30 detik
Q. In Java, methods usually hold the properties of an object.
Pilihan jawaban
True
False (*)

Pertanyaan 85 30 detik
Q. Which of the following scenarios would be ideal for writing a method?
Pilihan jawaban
When you don’t find similar lines of code to describe an object’s behavior.

For every five to six lines of code.

When you don’t want to repeat similar lines of code to describe an object’s behavior. (*)

To group similar data types together

Pertanyaan 86 30 detik
Q. Which two are valid import statements of the Scanner class?
Pilihan jawaban
import java.util.*; (*)

import java.util.Scanner; (*)

import java.util;

import java.*;

Pertanyaan 87 30 detik
Q. The import statement consists of two parts.

import package.className;

One is the package name and the other is the classname.

Pilihan jawaban
True (*)

False

Pertanyaan 88 30 detik
Q. Which is a valid way of calling the testMethod in the TestClass? Assume a testInstance has been
created.

public void testMethod(int x, double y){

System.out.println(x/y);

Pilihan jawaban
testInstance.testMethod(10);

testInstance.testMethod(10, 3.5); (*)

testInstance.testMethod(10, 3.5, 0);

testInstance.testMethod(3.5, 10);

testInstance.testMethod(3.5);

Pertanyaan 89 30 detik
Q. Once an object is instantiated, how might its fields and methods be accessed in Java?
Pilihan jawaban
Using the double-colon(::) operator

Using the dot(.) operator (*)

Using the comma(,) operator

Using the colon(:) operator

Pertanyaan 90 30 detik
Q. An argument is a value that's passed during a method call
Pilihan jawaban
True (*)

False

Pertanyaan 91 30 detik
Q. Methods allow all instance of a class to share same behaviors.
Pilihan jawaban
True (*)

False

Pertanyaan 92 30 detik
Q. You need to generate random integer values between 0 and 80 (inclusive). Which statement should
you use?
Pilihan jawaban
nextInt(0-79);

nextInt(80);

nextInt();

nextInt(81); (*)

Pertanyaan 93 30 detik
Q. Which values are returned by the method nextBoolean();
Pilihan jawaban
Returns the next value.

Either a true or false. (*)

Nothing is returned.

An integer value.

Pertanyaan 94 30 detik
Q. Using the Random class requires an import statement.
Pilihan jawaban
True (*)

False

Pertanyaan 95 30 detik
Q. Which class is used to generate random numbers?
Pilihan jawaban
Number

Integer

Double
Random (*)

Pertanyaan 96 30 detik
Q. Which two are the features of the Math class?
Pilihan jawaban
The Math methods can be invoked without creating an instance of a Math object. (*)

Common math functions like square root are taken care of in the language. (*)

You don’t have to worry about the data type returned from a Math method.

Math methods can be invoked with Strings as arguments.

Pertanyaan 97 30 detik
Q. What is the package name which contains Math class?
Pilihan jawaban
java.awt

java.lang (*)

java.net

java.io

Pertanyaan 98 30 detik
Q. What is the approximate value of PI?
Pilihan jawaban
2.718

The value varies.

3.141 (*)

Pertanyaan 99 30 detik
Q. Which is NOT true?
Pilihan jawaban
Static methods must be of return void. (*)

Static methods can be invoked through an instance of a class


Static methods can be invoked through the class name.

A class can have multiple static methods.

Pertanyaan 100 30 detik


Q. What is the output?
Pilihan jawaban
JAva World!

Java World!

JavA World!

JAvA World! (*)

Pertanyaan 101 30 detik


Q. String objects are immutable.
Pilihan jawaban
True (*)

False

Pertanyaan 102 30 detik


Q. What is the output?
Pilihan jawaban
orld!

rld! (*)

ld!

rld

Pertanyaan 103 30 detik


Q. What is the output?
Pilihan jawaban
Compilation error.

Java World! 8

Java World! + 8
Java World!8 (*)

Pertanyaan 104 30 detik


Q. What is the output of the following code?
Pilihan jawaban
Java World

World

JavaWorld (*)

Java

Pertanyaan 105 30 detik


Q. A String is a sequence characters.
Pilihan jawaban
True (*)

False

Pertanyaan 106 30 detik


Q. The String class must be imported using java.lang.String;
Pilihan jawaban
True (*)

False

Pertanyaan 107 30 detik


Q. The indexOf() method returns the index value of a character in the string.
Pilihan jawaban
True (*)

False

Pertanyaan 108 30 detik


Q. The String concat() method concatenates only String data types.
Pilihan jawaban
True (*)

False
Pertanyaan 109 30 detik
Q. The replaceFirst() method replaces only the first occurrence of matching character pattern in a string.
Pilihan jawaban
True (*)

False

Pertanyaan 110 30 detik


Q. Which method returns the length of a String?
Pilihan jawaban
charAt()

findLength ()

length()(*)

compareTo()

Pertanyaan 111 30 detik


Q. The Math class methods can be called without creating an instance of a Math object.
Pilihan jawaban
True (*)

False

Pertanyaan 112 30 detik


Q. You need to generate random integer values in the range 2 through 10. This code fragment will
produce the desired result.

Random r = new Random();

r.nextInt(9) + 2;

Pilihan jawaban
True (*)

False

Pertanyaan 113 30 detik


Q. A break statement causes control to transfer to the end of the switch statement.
Pilihan jawaban
True (*)

False

Pertanyaan 114 30 detik


Q. Which two of the following data types can be used in a switch statement?
Pilihan jawaban
Int (*)

boolean

float

String (*)

Pertanyaan 115 30 detik


Q. What is the output?
Pilihan jawaban
Compilation error

Vowels

Consonants (*)

Vowels

Pertanyaan 116 30 detik


Q. What is the output?
Pilihan jawaban
Congratulations

Congratulations! Good Work Average Barely Passing Failed (*)

Failed

Pertanyaan 117 30 detik


Q. A String comparison with == compares the Strings’ locations in memory and not the content of the
String.
Pilihan jawaban
True (*)
False

Pertanyaan 118 30 detik


Q. How should Strings be compared?
Pilihan jawaban
==

The equals() method (*)

~=

Pertanyaan 119 30 detik


Q. What is the output?
Pilihan jawaban
JavaProgramming

Java Programming

False

True (*)

Pertanyaan 120 30 detik


Q. What is the output?
Pilihan jawaban
Bob is 43 Bob is 50

Bob is 50

Bob is 43 (*)

No output

Pertanyaan 121 30 detik


Q. An if/else statement is used when you need to choose between two alternatives.
Pilihan jawaban
True (*)

False
Pertanyaan 122 30 detik
Q. Which three are conditional statements?
Pilihan jawaban
for loop

do while loop

switch statement (*)

if statement (*)

if/else statement (*)

Pertanyaan 123 30 detik


Q. Which are used in a boolean expression?

(Choose all correct answers)

Pilihan jawaban
Variables (*)

Errors

Operators (*)

Loops

Pertanyaan 124 30 detik


Q. In Java, an if statement can be nested inside another if statement.
Pilihan jawaban
True (*)

False

Pertanyaan 125 30 detik


Q. In a boolean expression which uses the && operator, what would make this expression evaluate to
true?

boolean x = (firstCondition && secondCondition);


Pilihan jawaban
If both the first condition and second condition are false

If the first condition is true, but the second condition is false

If the first condition is false, but the second condition is true

If both the first condition and second condition are true (*)

Pertanyaan 126 30 detik


Q. A customer is eligible for a discount based on certain criteria. Under what conditions does “You
qualify for a discount” print? (Hint: There may be more than one correct answer)

(Choose all correct answers)

Pilihan jawaban
When rewardPoints is more than 2000 or purchase greater than 1000

When purchase is 4000 and rewardPoints is 2000 (*)

When purchase is 2000 regardless of the value of rewardPoints (*)

When rewardPoints is more than 1000 and purchase is 1000

Pertanyaan 127 30 detik


Q. What is the result?
Pilihan jawaban
I scored 1 point

I scored 10 points (*)

Compilation error

I scored 1 point 10 points

Pertanyaan 128 30 detik


Q. Which two are not logical operators?

Choose all correct answers)


Pilihan jawaban
+ (*)

% (*)

&&

||

Pertanyaan 129 30 detik


Q. An employee is eligible for a bonus based on certain criteria.
Under what conditions does “Eligible for a bonus” print?

int rating;

int experience;

if (rating > 1 && experience == 5) {

System.out.println (“Eligible for a bonus”);

Pilihan jawaban
5 experience and 1 rating

5 experience and 2 or more rating (*)

5 rating and 1 experience

Less than 5 experience and 1 rating.

Pertanyaan 130 30 detik


Q. What are the possible values of a boolean data type in Java?
Pilihan jawaban
good/bad
yes/no

0/1

true/false (*)

Pertanyaan 131 30 detik


Q. Which operator is used to test if both sides of a boolean expression are equal?
Pilihan jawaban
<=

== (*)

>=

Pertanyaan 132 30 detik


Q. The equal sign (=) is used to make an assignment, whereas the == sign merely makes a comparison
and returns a boolean.
Pilihan jawaban
True (*)

False

Pertanyaan 133 30 detik


Q. The switch statement is a more efficient way to write code when dealing with a large range of
unknown values.
Pilihan jawaban
True

False (*)

Pertanyaan 134 30 detik


Q. What is the output?

public static void main(String args[]) {

char grade ='E';

if (grade == 'A') {
System.out.println("Excellent performer");

}else if (grade == 'B') {

System.out.println("Good Performer");

}else if (grade == 'C') {

System.out.println("Average Performer");

}else {

System.out.println("Below Average Performer");

Pilihan jawaban
Not a Good Performer

Excellent performer

Below Average Performer (*)

Below Performer

Pertanyaan 135 30 detik Laporkan masalah


Q. Which two of the following data types can be used in a switch statement?

(Choose all correct answers)

Pilihan jawaban
float

String (*)

boolean

int (*)

Вам также может понравиться