Question: Strings: Based on the method named strange below, what output, if any, is produced by this print statement in main: System.out.println ( strange (

Strings:
Based on the method named strange below, what output, if any, is produced by this print
statement in main:
System.out.println(strange("This is some crazy stuff!"));
public static String strange(String thes){
int a=1,b=3,c=5,d=0, val =0;
boolean t= false;
for (a=0;a thes. length ();a++
t= thes. charAt(a)=='';
if
val++;
switch(val){
case 1: b = a; break;
case 3: c=a; break;
default: d=a; break;
}
}
}
thes = thes.substring (c-4,c)+ thes.substring (d,d+6)+
thes.substring (b,b+3)+ thes.substring (c,c+6);
return thes;
}
The correct output is not listed here.
rats! crazy stuff!
This crazy stuff is crazy
This is crazy stuff
This is some crazy stuff!
some stuff is crazy
is This stuff crazy
 Strings: Based on the method named strange below, what output, if

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!