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

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Creating an Account and App on Parse.com

Java classes in android studio

I was wondering how to make a new Java class in android studio version 0.5.7. In Eclipse, you can just hit the new class button. However, in Android studio it does not give me the option of creating a new java class. Please help.

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hey Rohit! Here are the ways I can think of:

  • File > New > Java Class
  • Right-click on the package where you want to add it and select New > Java Class
  • Select the package in the Project pane on the left and hit CMD+N (Mac) or CTRL+N (Windows) and select Java Class

Thank you so much. I was right-clicking on the src folder, not the package. I was going to try to add a new java module and move the class from the module to the src folder. However this is much simpler. Once again thank you very much.