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 trialTara Edwards
6,521 PointsMy version of IntelliJ does not have constructors as a code generation option
The only option I get when I get to the Generate menu is "Copyright". I have looked through JetBrains, but they do not say what to do if a constructor is not on the menu. I could make a constructor, but that would not be the point of the lesson.
3 Answers
Ken Alger
Treehouse TeacherTara;
Code generation is somewhat intelligent in that if your cursor is not in a place inside your whatever.java
file in which a constructor would make sense, it won't prompt you to generate a constructor.
Ken
Tara Edwards
6,521 PointsI did not think that the constructor for the class should be within the class. So, the cursor was just outside of the class.
Tara Edwards
6,521 PointsOK, I watched the video and tried putting the cursor within the class. It showed constructor. So, I am OK now.
Ken Alger
Treehouse TeacherPleased it worked out!
Happy coding,
Ken
Tara Edwards
6,521 PointsTara Edwards
6,521 PointsMy cursor was put inside the SongRequest.java file. It is 15.0.2 version. So, is there something that I should have added?
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherWhere inside the file? Inside the
class
or just inside the file randomly? It makes a difference.