Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the output of the following code? Java C# class Main { public static void swap ( String str 1 , String str 2

What is the output of the following code?
Java
C#
class Main {
public static void swap(String str1, String str2){
String holdString;
holdString = str1;
str1= str2;
str2= holdString;
}
public static void main(String[] args){
String s1= "Computers";
String s2= "Rock";
swap(s1, s2);
System.out.println(s1+""+s2);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

Students also viewed these Databases questions

Question

Explain the different types of Mergers.

Answered: 1 week ago

Question

What is dividend payout ratio ?

Answered: 1 week ago