5 years ago in Java Strings

: If s = "text", what is the value returned by s.length()?

[A] 4
[B] 5
[C] True
[D] False
Loading...
Next Question

Overall Stats

Attempted 526
Correct 294
Incorrect 42
Viewed 190

Answers

Guest
Guest
Shamsa hafeez
Shamsa hafeez - 1 week ago

Shamsa hafeez from Lahore, Pakistan is saying 4 is correct answer

bruh
bruh - 1 month ago

bruh from Guwahati, India is saying 4 is correct answer

Assaad Amine
Assaad Amine - 1 month ago

Assaad Amine from Casablanca, Morocco is saying 4 is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying True is correct answer

Zo Go
Zo Go - 1 month ago

Zo Go from Casablanca, Morocco is saying 4 is correct answer

Related Questions

Which is a valid declarations of a String?

  • [A] String s1 = null;
  • [B] String s2 = 'null';
  • [C] String s3 = (String) 'abc';
  • [D] String s4 = (String) '\ufeed';

: A compound statement is:

  • [A] A collection of one or more statements enclosed in braces
  • [B] A statement involving if and else
  • [C] A way of declaring variables
  • [D] a way of setting the value of a variable

What is the output of the code ?
public class AQuestion{

      private int i = j;

      private int j = 10;

      public static void main(String args[]){

            System.out.println((new AQuestion()).i);

      }

}

  • [A] Compiler error complaining about access restriction of private variables of AQuestion.
  • [B] Compiler error complaining about forward referencing.
  • [C] No error - The output is 0;
  • [D] No error - The output is 10;