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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![poltexious](https://secure.gravatar.com/avatar/b1407b81d1446f34593a806ff1671ee3?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
poltexious
Courses Plus Student 6,993 PointsDid Ben forget to add "return Pizza(toppings);" in orderPizza method in Example.java?
I just want to be sure if I am missing something, or if Ben forgot to return the Pizza object with input parameter(s) in the orderPizza method in Example.java?
public Pizza orderPizza(String toppings) {
// code to make the Pizza goes here
}
I mean, when one declares the return type with input parameter(s) in a method, should one not return it in the end of the method? Is there something wrong with my understanding, or should Ben write the following instead?
public Pizza orderPizza(String toppings) {
// code to make the Pizza goes here
return Pizza(toppings);
}
1 Answer
![Ryan Farber](https://uploads.teamtreehouse.com/production/profile-photos/1777612/micro_381262_10150555969312788_1119178467_n.jpg)
Ryan Farber
5,329 PointsYou are correct. I think he wanted to keep it simple rather than explain that part. Ben would have had to explain why he needed to return the topping, which would probably have added an unneeded minute or two to the video.
poltexious
Courses Plus Student 6,993 Pointspoltexious
Courses Plus Student 6,993 PointsOK. I just got confused that he did not include that piece of (important) information :-)