U2L4 FS

.pdf

School

Rowan College, Burlington County *

*We aren’t endorsed by this school

Course

111

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

2

Uploaded by MagistrateDiscoveryKangaroo81

9/30/21, 11:43 AM Quiz: Unit 2: Lesson 4 - Fast Start https://courses.projectstem.org/courses/10083/quizzes/220983/take 1/2 Unit 2: Lesson 4 - Fast Start Started: Sep 30 at 11:42am Quiz Instructions In the first few lessons of this unit, we learned what a class data type was. Now we will explore in greater depth what we mean by a "class" and an "object". Before you start today, be sure you feel comfortable with the following topics: String functions - Unit 2: Lesson 3 Class data types - Unit 2: Lesson 1 1 pts Question 1 lement emen ement leme lemen Suppose the String s is declared and initialized as follows: String s = "elementary"; What String would be returned by the method call s.substring(2, 6); ? 1 pts Question 2 What will be printed by the following code? String s = "Animal"; System.out.println(s.indexOf("an"));
9/30/21, 11:43 AM Quiz: Unit 2: Lesson 4 - Fast Start https://courses.projectstem.org/courses/10083/quizzes/220983/take 2/2 Not saved 0 -1 1 false Nothing is printed, an error occurs 1 pts Question 3 s1 and s2 are identical strings s1 appears before s2 alphabetically s1 appears after s2 alphabetically Suppose s1 and s2 are Strings and the following code is run: s1 = s1.toLowerCase(); s2 = s2.toLowerCase(); System.out.println(s1.compareTo(s2)); If the code causes -25 to be output, which of the following must be true Submit Quiz
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help