QUESTION 1 To obtain the current minute, use ________. System.currentTimeMillis(
ID: 3844317 • Letter: Q
Question
QUESTION 1
To obtain the current minute, use ________.
System.currentTimeMillis() % 3600
System.currentTimeMillis() % 60
System.currentTimeMillis() / 1000 % 60
System.currentTimeMillis() / 1000 / 60 % 60
System.currentTimeMillis() / 1000 / 60 / 60 % 24
0.5 points
QUESTION 2
You can always assign a value of long type to a variable of int type without loss of precision.
true
false
0.5 points
QUESTION 3
The keyword ________ must be used to declare a constant.
const
final
static
double
int
0.5 points
QUESTION 4
To assign a value 1 to variable x, you write ________.
1 = x;
x = 1;
x := 1;
1 := x;
x == 1;
0.5 points
QUESTION 5
-24 % 5 is ________.
-1
-2
-3
-4
0
0.5 points
QUESTION 6
-5 % 5 is ________.
-1
-2
-3
-4
0
0.5 points
QUESTION 7
1.0
2.0
3.0
4.0
0.5 points
QUESTION 8
To declare an int variable x with initial value 200, you write ________.
int x = 200L;
int x = 200l;
int x = 200;
int x = 200.0;
0.5 points
QUESTION 9
To declare an int variable number with initial value 2, you write ________.
int number = 2L;
int number = 2l;
int number = 2;
int number = 2.0;
0.5 points
QUESTION 10
5 % 5 is ________.
1
2
3
4
0
0.5 points
QUESTION 11
To obtain the current second, use ________.
System.currentTimeMillis() % 3600
System.currentTimeMillis() % 60
System.currentTimeMillis() / 1000 % 60
System.currentTimeMillis() / 1000 / 60 % 60
System.currentTimeMillis() / 1000 / 60 / 60 % 24
0.5 points
QUESTION 12
The ________ method returns a raised to the power of b.
Math.power(a, b)
Math.exponent(a, b)
Math.pow(a, b)
Math.pow(b, a)
0.5 points
QUESTION 13
What is x after the following statements?
int x = 2;
int y = 1;
x *= y + 1;
x is 1.
x is 2.
x is 3.
x is 4.
0.5 points
QUESTION 14
Suppose x is 1. What is x after x += 2?
0
1
2
3
4
0.5 points
QUESTION 15
The program displays month is 09.
The program displays month is 9.
The program displays month is 9.0.
The program has a syntax error, because 09 is an incorrect literal value.
0.5 points
QUESTION 16
y is 1.
y is 2.
y is 3.
y is 4.
0.5 points
QUESTION 17
To declare a constant MAX_LENGTH inside a method with value 99.98, you write ________.
final MAX_LENGTH = 99.98;
final float MAX_LENGTH = 99.98;
double MAX_LENGTH = 99.98;
final double MAX_LENGTH = 99.98;
0.5 points
QUESTION 18
Which of these data types requires the most amount of memory?
long
int
short
byte
0.5 points
QUESTION 19
24 % 5 is ________.
1
2
3
4
0
0.5 points
QUESTION 20
currentTimeMills is a method in the ________ class.
Integer
Double
Math
System
0.5 points
QUESTION 21
The assignment operator in Java is ________.
:=
=
= =
<-
0.5 points
QUESTION 22
-15 % 4 is ________.
-1
-2
-3
-4
0
0.5 points
QUESTION 23
What is 1 % 2?
0
1
2
0.5 points
QUESTION 24
The expression (int)(76.0252175 * 100) / 100 evaluates to ________.
76.02
76
76.0252175
76.03
0.5 points
QUESTION 25
Math.pow(4, 1.0 / 2) returns ________.
2
2.0
0
1.0
1
0.5 points
QUESTION 26
To improve readability and maintainability, you should declare ________ instead of using literal values such as 3.14159.
variables
methods
constants
classes
0.5 points
QUESTION 27
Which of the following is a constant, according to Java naming conventions?
MAX_VALUE
Test
read
ReadInt
0.5 points
QUESTION 28
What is the printout of the following code?
double x = 5.5;
int y = (int)x;
System.out.println("x is " + x + " and y is " + y);
x is 5 and y is 6
x is 6.0 and y is 6.0
x is 6 and y is 6
x is 5.5 and y is 5
x is 5.5 and y is 5.0
0.5 points
QUESTION 29
-25 % 5 is ________.
1
2
3
4
0
0.5 points
QUESTION 30
0
1
5
6
0.5 points
QUESTION 31
Yes
No
0.5 points
QUESTION 32
Every letter in a Java keyword is in lowercase?
true
false
0.5 points
QUESTION 33
If you attempt to add an int, a byte, a long, and a double, the result will be a ________ value.
byte
int
long
double
0.5 points
QUESTION 34
5 % 4 is ________.
1
2
3
4
0
0.5 points
QUESTION 35
The compiler checks ________.
syntax errors
logical errors
runtime errors
0.5 points
QUESTION 36
The System.currentTimeMillis() returns ________.
the current time
the current time in milliseconds
the current time in milliseconds since midnight
the current time in milliseconds since midnight, January 1, 1970
the current time in milliseconds since midnight, January 1, 1970 GMT (the Unix time)
0.5 points
QUESTION 37
Math.pow(4, 1 / 2) returns ________.
2
2.0
0
1.0
1
0.5 points
QUESTION 38
________ is the Java assignment operator.
==
:=
=
=:
0.5 points
QUESTION 39
To declare a constant PI, you write ________.
final static PI = 3.14159;
final float PI = 3.14159;
static double PI = 3.14159;
final double PI = 3.14159;
0.5 points
QUESTION 40
What is x after the following statements?
int x = 1;
x *= x + 1;
x is 1.
x is 2.
x is 3.
x is 4.
0.5 points
QUESTION 41
The keywords in Java are all in lowercase.
true
false
1 points
QUESTION 42
The main method header is written as ________.
public static void main(string[] args)
public static void Main(String[] args)
public static void main(String[] args)
public static main(String[] args)
public void main(String[] args)
1 points
QUESTION 43
Which of the following statements is correct?
Every line in a program must end with a semicolon.
Every statement in a program must end with a semicolon.
Every comment line must end with a semicolon.
Every method must end with a semicolon.
Every class must end with a semicolon.
1 points
QUESTION 44
The compiler generates bytecode even if the program has syntax errors.
true
false
1 points
QUESTION 45
________ is a device to connect a computer to a local area network (LAN).
Regular modem
DSL
Cable modem
NIC
1 points
QUESTION 46
Java was developed by ________.
Sun Microsystems
Microsoft
Oracle
IBM
Cisco Systems
1 points
QUESTION 47
The extension name of a Java source code file is ________.
.java
.obj
.class
.exe
1 points
QUESTION 48
________ is a technical definition of the language that includes the syntax and semantics of the Java programming language.
Java language specification
Java API
Java JDK
Java IDE
1 points
QUESTION 49
A Java program block starts with an open brace ({) and ends with a closing brace (}).
true
false
1 points
QUESTION 50
________ contains predefined classes and interfaces for developing Java programs.
Java language specification
Java API
Java JDK
Java IDE
1 points
QUESTION 51
Java ________ can run from a Web browser.
applications
applets
servlets
Micro Edition programs
1 points
QUESTION 52
Java compiler translates Java source code into ________.
Java bytecode
machine code
assembly code
another high-level language code
1 points
QUESTION 53
If you forget to put a closing quotation mark on a string, what kind error will be raised?
a compilation error
a runtime error
a logic error
1 points
QUESTION 54
I
II
III
IV
1 points
QUESTION 55
Which JDK command is correct to run a Java application in ByteCode.class?
java ByteCode
java ByteCode.class
javac ByteCode.java
javac ByteCode
JAVAC ByteCode
1 points
QUESTION 56
________ is interpreted.
Java
C++
C
Ada
Pascal
1 points
QUESTION 57
The ________ loads Java bytecode to the memory.
Java virtual machine
bytecode verifier
class loader
Java compiler
1 points
QUESTION 58
________ is the physical aspect of the computer that can be seen.
Hardware
Software
Operating system
Application program
1 points
QUESTION 59
________ is the brain of a computer.
Hardware
CPU
Memory
Disk
1 points
QUESTION 60
Computer can execute the code in ________.
machine language
assembly language
high-level language
None of these
System.currentTimeMillis() % 3600
System.currentTimeMillis() % 60
System.currentTimeMillis() / 1000 % 60
System.currentTimeMillis() / 1000 / 60 % 60
System.currentTimeMillis() / 1000 / 60 / 60 % 24
Explanation / Answer
Answers for 60 bits are:
1)System.currentTimeMillis() / 1000 % 60;
2)false
3)const
4)x=1;
5)-4
6)0
7)
8)int x=200;
9)int number=20;
10)0
11)System.currentTimeMillis() % 60;
12)Math.pow(a,b)
13)x=4
14)x=3
15)
16)
17)final double MAX_LENGTH=99.98;
18)long
19)4
20)double
21)=
22)-3
23)1
24)76
25)2.0
26)constants
27)MAX_VALUE
28)x is 5.5 and y is 5
29)0
30)
31)
32)false
33)double
34)1
35)syntax error
36)current time in milliseconds
37)1.0
38)=
39)final double PI = 3.14159;
40)2
41)yes
42)public static void main(String[] args)
43)Every statement in a program must end with a semicolon.
44)false
45)NIC
46)Sun Microsystems
47).java
48)java language specification
49)true
50)java API
51)applications
52)java bytecode
53)compile time
54)
55)java ByteCode
56)c++
57)class loader
58)Hardware
59)CPU
60)assembly language
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.