113k views
2 votes
Question 1

Which of the following would Java recognize as a String?
"%.*
i 8a
"4bout T!me"
O "word"
Question 2

1 Answer

2 votes

Answer:

The answer is "4bout T!me" and "word"

Step-by-step explanation:

In the given java program code, the two choices that are "4bout T!me" and "word" were correct, because it uses the double quote, and its example can be defined as follows:

Example:

public class Exa //defining class Exa

{

public static void main(String[] args) //defining main method

{

String x ="4bout T!me";//defining String variable x and assign value

String y ="word";//defining String variable y and assign value

System.out.println(x+" "+y);//print message

}

}

Output:

4bout T!me word

User Maman
by
5.0k points