Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Annotations Using Java's Built-In Annotations Using the @Deprecated Annotation

Joseph Wagner
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Wagner
Android Development Techdegree Graduate 27,137 Points

Deprecated Annotation Code Challenge

I'm trying to pass this code challenge but I think there's something wrong with the challenge. It says I need to take a long parameter although the description says int. Does anyone see what I'm doing wrong here?

As the lead developer of an online music service, you have decided to remove the existing buyAlbum method. You'll replace it with a new void buyAlbum method that instead accepts an int parameter for the album ID. Deprecate the existing method and add the method described to the MusicServiceUser class. You don't need to include any code within your new method.

MusicServiceUser.java
public class MusicServiceUser {
  @Deprecated
  public void buyAlbum(String albumName) {
    // Leave this blank
  }
  public void buyAlbumNew(Long albumId) {
  //
  }
}

2 Answers

Rares Conea
PLUS
Rares Conea
Courses Plus Student 15,000 Points

Hi,

You are using a wrong name for your method, just change the name of your new method to be the same as the existing one and give it an int albumID parameter:

hie the question want you to change the parameter only. u was suppose to use (int) instead of Long