Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++t=*charAt(a)==d=a=(c-4,c)+(d,d+6)+(b,b+3)+(c,c+6)(a=0;a. length ();a++){
t= thes *charAt(a)=='';
if(t){
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;
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions