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

Java Introducing IntelliJ and Unpacking Packages Introducing IntelliJ and Unpacking Packages Introducing IntelliJ and Unpacking Packages

importing another class

Can someone please explain why my line of code to import the finger class will not work. Thank you.

To use the Finger class in our Main class it'll need to be imported. Fill in the blank to import the Finger class. package com.teamtreehouse;

import com.teamtreehouse.bodyparts; <------------this line of code shows an error, I don't understand why

public class Main { public static void main(String[] args) { Finger finger = new Finger(); finger.fing(); } }

package com.teamtreehouse.bodyparts;

public class Finger { public void fing() { //TODO: implement finging } }

2 Answers

Molly James
Molly James
18,386 Points

Classes need to be specified in order to draw them out of their package. That line has no .Finger (or for a more general solution a .*) at the end of it.

import com.teamtreehouse.bodyparts.Finger;