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 trialAkshay Ramdasi
14,065 Pointsbuild a fx application
cant complete the challenge! Help me resolve this
package com.example.model;
public enum Brand { JVC("JVC"), SONY("Sony"), COBY("Coby"), APPLE("Apple");
public String nName;
Brand(String Sony) {
nName = Sony;
}
public Brand getName() {
return nName;
}
1 Answer
Sean Keegan
6,255 PointsI'm assuming you need help with part two. Let me know if this is not the case.
Great use of camelCase to differentiate the member variables. Them being called 'member' variables is why we use an m and not an n :) - Easy mistake to make.
I'd use 'brand' or something similar here instead of 'Song' personally, I feel that it makes things confusing
Brand(String Sony) {
nName = Sony;
}
BECOMES
Brand(String brand) {
mBrandName = brand;
}
You are not able to pass the test because you are not doing what the question asks of you - Don't return a 'Brand' datatype, return something else :) It's not too complicated this one, it's just a simple getter.
Also, make sure that it is name as the task requests :)
Good luck!
Akshay Ramdasi
14,065 PointsAkshay Ramdasi
14,065 PointsI got the answer: