aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Basic Online Quiz
  • What is the value of "This is Patrick".length()?
Multiple choice

What is the value of "This is Patrick".length()?

  1. Syntax error

  2. 15

  3. 13

  4. 17

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The length() method of a String returns the total number of characters, including spaces and punctuation. Counting each character in "This is Patrick" yields exactly 15.

Keep practicing — related questions

  • What would the following code output
  • A variable whose length may vary during the execution of the program as long as the length does not exceed ...
  • class Test1 { public int value; public int hashCode() { return 42; } } class Test2 { public int value; publ...
  • In a trapezoid, the lengths of the two parallel sides are 12 units and 20 units. If one of the oblique side...
  • Area of a square is 64 sq. metres, what is the area of the rectangle whose length is equal to the length of...
  • A ___________ key value must match an existing primary key value or unique key value.
  • Which of the following files holds attributes and their values, however any change to a attribute's values ...
  • Which of the following SQL functions returns the number of values from the specified column with no NULL va...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy