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 Writing Your Own Annotation Adding Annotation Targets and Elements

Challenge won't accept the correct answer

I have been stuck at this code challenge for about an hour now and I can't seem to figure out the correct answer. Oh wait, what I've written IS the correct answer. I don't understand why it won't accept it. I even re-watched the video regarding this and this is the correct code.

Any answer is appreciated! Thank you!

LiveTweet.java
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import java.lang.annotation.Target;
import java.lang.annotation.ElementType;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface LiveTweet {

  String username() default "";

  String[] hastags() default {}; 
}

1 Answer

You misspelled "hashtags" :)

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import java.lang.annotation.Target;
import java.lang.annotation.ElementType;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface LiveTweet {

  String username() default "";

  String[] hashtags() default {}; 
}

kill me...

haha, it's always something obvious.