Question: Consider the code : String s; Scanner in = new Scanner(System. in ); System. out .print(Enter a word: ); s = in.next(); 5.1 write one

Consider the code :

String s;

Scanner in = new Scanner(System.in);

System.out.print("Enter a word: ");

s = in.next();

5.1 write one statement to test if the user enters the string "Hello".

5.2 assume s = "I love KSA " ;

What is the output the following code ?

String S1= s.substring(4,10);

System.out.println(S1);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!