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 Data Structures - Retired Getting There Override an inherited method

help me what'swrong???

I was stucked help me

Hey jinhwa,

can you post your code pleae?

1 Answer

Hi do this inside your code:

@Override
  public String toString() {
    return "BlogPost:" + mTitle + "by" + mAuthor;
  }

When you try to call a BlogPost object as a String value, it will return the above String

μ–΄λ €μš΄λ° μž˜λΆ€νƒν•΄μš”...

닡이 μ•„λ‹Œλ°μš”?????

μ •λ§μš”?? μž¬κ°€ λ‹€μ‹œ ν–ˆλŠ”λ°, 문제 μ—†μ—ˆμ–΄μš”

μ•„ ν•΄κ²°λμ–΄μš”.. λ‹€λ₯Έ λ¬Έμ œμ˜€μ–΄μš”... κ°μ‚¬ν•΄μš”

γ…Žγ…Ž κ·Έλ ‡κ΅°μš”. μ•žμœΌλ‘œ ν™”μ΄νŒ…!

그런데 λ„ˆλ¬΄ μ–΄λ €μ›Œμ„œ.. ν˜Ήμ‹œ λ©”μ‹ μ €λ‚˜ νŽ˜μ΄μŠ€λΆμžˆλ‚˜μš”? μΉœκ΅¬μΆ”κ°€ ν• λ €κ΅¬μš”..γ…Žγ…Ž μ‹€μ‹œκ°„ 으둜 λ¬Όμ–΄λ³Όλ €κ΅¬μš”

γ…Žγ…Ž λ§žμ•„μš”. 이거 μ—„μ²­ μ–΄λ €μ›Œμš”. 근데 사싀이 μš”μ¦˜ μ‹œκ°„ μ—†μœΌλ‹ˆκΉŒ 도와쀄 수 μ—†μ–΄μš”. λŒ€ν•™ μ‹œν—˜μ€ λ‹€μŒ μ£Ό μ‹œμž‘ν•΄μš” γ… γ… . μ£„μ†‘ν•΄μš”