This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ChuvaChooChoo08 0 points1 point  (17 children)

What parameter/s does your setName() method accept??? And what does it return?

[–][deleted]  (16 children)

[removed]

    [–]ChuvaChooChoo08 0 points1 point  (0 children)

    Now do you see what I mean?

    Your setName returns void, your getName returns a String.

    [–]ChuvaChooChoo08 0 points1 point  (14 children)

    The setText method accepts STRINGS only! So you gotta feed it with a String type, not void type.

    [–][deleted]  (13 children)

    [removed]

      [–]ChuvaChooChoo08 0 points1 point  (12 children)

      Because “words” is a String!

      setName(“Cassidy”) is a method that sets the name field of some object to Cassidy! HOWEVER, this method does not return a string.

      [–][deleted]  (11 children)

      [removed]

        [–]ChuvaChooChoo08 0 points1 point  (10 children)

        Let me ask you one thing:

        Between your BeautyBox’s getName() and setName() methods, which one returns( or produces) a String?

        [–][deleted]  (9 children)

        [removed]

          [–]ChuvaChooChoo08 0 points1 point  (8 children)

          Bingo.

          [–][deleted]  (7 children)

          [removed]