Assume array x [ ] = {1, 3, 5, 2}. x[4]= _______ a. 3 b. Error c. 2 d. 5 Clear my choice Question 2 Not yet answered Mar
Posted: Fri May 20, 2022 11:31 am
Assume array x [ ] = {1, 3, 5, 2}.
x[4]= _______
a.
3
b.
Error
c.
2
d.
5
Clear my choice
Question 2
Not yet answered
Marked out of 2.00
Flag question
Question text
Assume array x [ ][ ] = { {1,2,3}, {4,5,6} };
x[2][2]= _____ ?
a.
5
b.
6
c.
3
d.
error
Clear my choice
Question 3
Not yet answered
Marked out of 2.00
Flag question
Question text
Which of the following statement causes an error?
a.
System.out.printf("%d" + num);
b.
System.out.print("Number= " , num);
c.
None
d.
Both of them
Clear my choice
Question 4
Not yet answered
Marked out of 2.00
Flag question
Question text
Which of the following is not a valid java identifier?
a.
ITCS122
b.
ITC$122
c.
ITCS_122
d.
122ITCS
Clear my choice
Question 5
Not yet answered
Marked out of 2.00
Flag question
Question text
__________ are used to document programs and improve their
readability. They are ignored by the compiler.
a.
classes
b.
comments
c.
methods
d.
variables
Clear my choice
Question 6
Not yet answered
Marked out of 2.00
Flag question
Question text
A Java program starts by executing the __________
a.
Package
b.
Main method
c.
Printing statements
d.
Class
Clear my choice
Question 7
Not yet answered
Marked out of 2.00
Flag question
Question text
Math Function used to find the largest integer value which is
less than or equal to the argument and is equal to the mathematical
integer of a double value:
a.
Math.floor()
b.
Math.Ceil()
c.
Math.round()
d.
Math.ceil()
Clear my choice
Question 8
Not yet answered
Marked out of 2.00
Flag question
Question text
What is the output of the following segment of
code? Math.floor(Math.min(-6.8, -4.2))
a.
6.0
b.
7.0
c.
-6.0
d.
-7.0
Clear my choice
Question 9
Not yet answered
Marked out of 2.00
Flag question
Question text
String courseCode= "ITCS122";
String msg= "Welcome to ";
Which statement shall give the
output: ITCS222
a.
System.out.println(courseCode.replace(4, "2"));
b.
System.out.println(courseCode.replace("2", "1"));
c.
System.out.println(courseCode.replace("1", "2"));
d.
System.out.println(courseCode.replace("2", 4));
Clear my choice
Question 10
Not yet answered
Marked out of 2.00
Flag question
Question text
Which String function Returns a copy of the string, with
leading and trailing whitespace omitted?
a.
Omit
b.
none
c.
Trims
d.
Trim
x[4]= _______
a.
3
b.
Error
c.
2
d.
5
Clear my choice
Question 2
Not yet answered
Marked out of 2.00
Flag question
Question text
Assume array x [ ][ ] = { {1,2,3}, {4,5,6} };
x[2][2]= _____ ?
a.
5
b.
6
c.
3
d.
error
Clear my choice
Question 3
Not yet answered
Marked out of 2.00
Flag question
Question text
Which of the following statement causes an error?
a.
System.out.printf("%d" + num);
b.
System.out.print("Number= " , num);
c.
None
d.
Both of them
Clear my choice
Question 4
Not yet answered
Marked out of 2.00
Flag question
Question text
Which of the following is not a valid java identifier?
a.
ITCS122
b.
ITC$122
c.
ITCS_122
d.
122ITCS
Clear my choice
Question 5
Not yet answered
Marked out of 2.00
Flag question
Question text
__________ are used to document programs and improve their
readability. They are ignored by the compiler.
a.
classes
b.
comments
c.
methods
d.
variables
Clear my choice
Question 6
Not yet answered
Marked out of 2.00
Flag question
Question text
A Java program starts by executing the __________
a.
Package
b.
Main method
c.
Printing statements
d.
Class
Clear my choice
Question 7
Not yet answered
Marked out of 2.00
Flag question
Question text
Math Function used to find the largest integer value which is
less than or equal to the argument and is equal to the mathematical
integer of a double value:
a.
Math.floor()
b.
Math.Ceil()
c.
Math.round()
d.
Math.ceil()
Clear my choice
Question 8
Not yet answered
Marked out of 2.00
Flag question
Question text
What is the output of the following segment of
code? Math.floor(Math.min(-6.8, -4.2))
a.
6.0
b.
7.0
c.
-6.0
d.
-7.0
Clear my choice
Question 9
Not yet answered
Marked out of 2.00
Flag question
Question text
String courseCode= "ITCS122";
String msg= "Welcome to ";
Which statement shall give the
output: ITCS222
a.
System.out.println(courseCode.replace(4, "2"));
b.
System.out.println(courseCode.replace("2", "1"));
c.
System.out.println(courseCode.replace("1", "2"));
d.
System.out.println(courseCode.replace("2", 4));
Clear my choice
Question 10
Not yet answered
Marked out of 2.00
Flag question
Question text
Which String function Returns a copy of the string, with
leading and trailing whitespace omitted?
a.
Omit
b.
none
c.
Trims
d.
Trim