151k views
0 votes
1000 POINTS PLEASE NOW

What is the value of tiger after these Java statements execute?



String phrase = "Hello world!";
int tiger = phrase.length( );

User Matusalem
by
7.5k points

1 Answer

3 votes

Answer:

See below, please.

Step-by-step explanation:

The value of tiger will be 12, which is the length of the string "Hello world!" stored in the variable 'phrase'.

The length() method in Java returns the number of characters in a string. Here, it is applied to the string "Hello world!" stored in the variable 'phrase', and the resulting value (which is 12) is assigned to the variable 'tiger'.

User Jeson Dias
by
7.8k points