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 trialVidit 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?