arrays and strings in java

Quiz
•
Computers
•
12th Grade
•
Medium

Geetu Chopra
Used 56+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Is String a primitive data type?
Yes
No
Both
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
What is the correct way to find the length of "txt" string?
int len = length(txt);
float len = txt.length();
int len = txt.length();
double len = length(txt);
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Choose correct purpose of indexOf() in String class.
returns the index (the position) of the last occurrence of a specified text in a string
returns the character of the first occurrence of a specified character in a string
returns the index (the position) of the first occurrence of a specified text in a string (excluding whitespace)
returns the index (the position) of the first occurrence of a specified text in a string (including whitespace)
4.
MULTIPLE SELECT QUESTION
1 min • 1 pt
What will be the output of below code?
String statement = "Outfit of the day";
System.out.println(statement.Substring(3,6));
it of
tfit
fit
FIT
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Choose most appropriate purpose of trim() method in String?
to remove white spaces
to get a substring of the string
to cut String at desired index
to remove extra white spaces from start and end of String
6.
MULTIPLE SELECT QUESTION
1 min • 1 pt
(Multiple answer question)
Pick all NON-primitive datatypes from below :
String
int
primitive
Array
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct relation between length and last-index of array?
last-index is always 1 more than the length
last-index is 1 less than the length (but not always)
last-index is always 1 less than the length
last-index is always equal to the length
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Python

Quiz
•
9th - 12th Grade
21 questions
Programming - Python (year 12)

Quiz
•
9th - 12th Grade
25 questions
AP CSA Unit 1&2 Test

Quiz
•
8th Grade - Professio...
20 questions
Functions, Loops, Arrays, Objects

Quiz
•
9th - 12th Grade
20 questions
ict5_mt_w2_sw2

Quiz
•
12th Grade - University
20 questions
Arrays in Java

Quiz
•
9th - 12th Grade
25 questions
#100 Devs - LwL - class 15

Quiz
•
10th Grade - Professi...
20 questions
12 CSC ATAR - programming skills and concepts

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade