Question: Java simple bugs Show key = new Show( Short Circuit, 1986 ); Show someShow = new Show( Short Circuit, 1986 ); if(key == someShow){ System.out.println(key

Java simple bugs

Show key = new Show( "Short Circuit", 1986 );

Show someShow = new Show( "Short Circuit", 1986 );

if(key == someShow){ System.out.println(key + " " + someShow + " are the same"); System.out.println(); }

else if (key != someShow){ System.out.println(key + " " + someShow + " are not the same"); System.out.println(); }

for some reason the key and some show are not equal i am not sure what do i write wrong, even though they are the same.

the show constructor only have 2 parameter

public Show(String title, int year) { this.title = new String( title ); this.year = year; }

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!