Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Vidit Shah
6,037 PointsWhat's Wrong here? task 2?Java FX
I can't understand where am I going Wrong
package com.example.model;
public enum Brand {
// Your code here
JVC,SONY,COBY,APPLE;
private String mSony;
private String mApple;
private String mCoby;
private String mJvc;
Brand(String sony,String apple,String coby,String jvc)
{
mSony=sony;
mApple=apple;
mCoby=coby;
mJvc=jvc;
}
public String getDisplayName()
{
return mSony;
return mApple;
return mCoby;
return mJvc;
}
}
2 Answers

La Gracchiatrice
4,615 Pointstoo many or only return statement in getDisplayName() method

La Gracchiatrice
4,615 Pointspackage com.example.model;
public enum Brand {
JVC("JVC"),
SONY("Sony"),
COBY("Coby"),
APPLE("Apple");
private String mName;
Brand (String name){
mName=name;
}
public String getDisplayName(){
return mName;
}
}

Jordan Bester
4,752 PointsHey i have question about the Private String mName;? I dont understand its purpose?