Assume you have the following array: int[] a = {1,2,3,4,5}; How would you increment the fourth element in the array by one?
Christianson

Quiz
•
Computers
•
11th Grade
•
Medium

Mr. Christianson
Used 20+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
3++;
4++;
a[2]++;
a[3]++;
a[4]++;
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the String method indexOf() do?
Returns the location of a certain character in the String object.
Tests two String objects for equality.
Compares this String with a secondString for greater than, equal to or less than
Returns the character at a certain location.
Returns the length of a String.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code:
String str = "Computer Science";
Which of the following statements correctly prints the last character in the String str?
System.out.println(str.charAt(0));
System.out.println(str.charAt(1));
System.out.println(str.charAt(str.length()));
System.out.println(str.charAt(str.length() - 1 ));
. System.out.println(str.charAt(str.length() + 1 ));
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following Strings:
s1 = "PH";
s2 = "ph";
s3 = "Patrick Henry";
Given that P comes before p in dictionary order, which of the following is true?
s1.compareTo(s2) < 0 && s2.compareTo(s3) < 0
s2.compareTo(s1) < 0 || s3.compareTo(s1) < 0
s3.compareTo(s1) < 0 && s1.compareTo(s2) < 0
! (s1.equals(s2) && s3.compareTo(s2) < 0)
s1.compareTo(s2) <= 0 && s2.compareTo(s3) < 0
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The index of the last element of an array is ______.
.size
.length
.length - 1
.size - 1
.length()
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code:
if(s.toLowerCase().equals(s.toUpperCase()) System.out.println("*");
Tests if the String s contains only non-letter characters.
Tests if the String s contains Only upper-case letters.
Tests if the String s contains only digits.
Tests if the String s contains Only lower-case letters.
None of the above
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following can be stored in a standard array?
ints
Strings
boolean
doubles
All of the above
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Understanding Input, Selection and Loops in Python

Quiz
•
7th Grade - University
25 questions
Remidial PSAS 2023

Quiz
•
11th Grade
34 questions
Project STEM AP CS A Unit 1

Quiz
•
9th - 12th Grade
25 questions
Penilaian Harian Bahasa Kotlin SMT 1 2023

Quiz
•
11th Grade
25 questions
Chapter 2 Review

Quiz
•
10th - 12th Grade
25 questions
SAINS KOMPUTER TINGKATAN 4 - 1.6 STRUKTUR DATA DAN MODULAR

Quiz
•
7th - 12th Grade
26 questions
Java - Flow of Control Quiz

Quiz
•
9th - 12th Grade
25 questions
ulangkaji sains komputer ting 4 bab 1

Quiz
•
11th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade