Question: The following two code snippets represent two different files, the first is CallSwift.java and the second is Swift.java CallSwift.java: public class CallSwift { public static

The following two code snippets represent two different files, the first is "CallSwift.java" and the second is "Swift.java"
CallSwift.java:
public class CallSwift {
public static void main(String[] args){
Swift albumSwift = new Swift();
albumSwift.print();
albumSwift.setName("Reputation");
albumSwift.setYear(2017);
albumSwift.print();
}
}
Swift.java:
public class Swift {
private String name = "NoName";
private int year =-1;
public void setName(String albumName){
name = albumName;
}
public void setYear(int albumYear){
year = albumYear;
}
public void print(){
System.out.println(name +""+ year);
}
}
What is the output?
Group of answer choices
Reputation 2017
Reputation 2017
Reputation 2017
NoName -1
Reputation 2017
NoName -1

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!