Results 1 to 3 of 3
  1. #1
    GreenTea1984 is offline Member
    Join Date
    Jun 2015
    Rep Power

    Default Help with Multiple Classes, Objects, and Methods in Java

    Hi, I'm learning Java programming through a Youtube video. Int his video the topic is multiple classes, objects, and methods. In the video I was told to go into my IDE (Netbeans), to create a new class call tuna from my source package and name the newly created class tuna. So now I have two .java file types; one is MultipleClasses which contains my main method and the newly created class and method call simpleMessage in

    Here is the class containing my main method call file:

    package multipleclasses;

    public class MultipleClasses {

    public static void main(String args[]) {

    tuna tunaObject = new tuna();


    Here is my newly created class file:

    public class tuna {

    public void simpleMessage() {
    System.out.println("This is another class");


    When I follow the video I input the code exactly and checked it for spelling or syntax errors, and I run the code in my Netbeans IDE I get this error build message;

    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
    symbol: class tuna
    location: class multipleclasses.MultipleClasses
    at multipleclasses.MultipleClasses.main(MultipleClass
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)

    What is going on here? I followed the instructional video exactly. How did it work for him, vene though he was using Eclipse?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: Help with Multiple Classes, Objects, and Methods in Java

    Since their are no import statements I would presume tuna is in the same package. So put the same package definition in your tuna class. Also,
    by convention class names begin with uppercase letters. Variables and methods with lower case letters. Check out my signature for more on Java naming conventions.

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Help with Multiple Classes, Objects, and Methods in Java

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Java Objects and Classes
    By njcountrygirl in forum New To Java
    Replies: 3
    Last Post: 03-15-2015, 06:09 PM
  2. how to use get and set methods for multiple classes
    By comptechgivinsky in forum New To Java
    Replies: 3
    Last Post: 11-06-2012, 05:14 PM
  3. Replies: 1
    Last Post: 09-09-2011, 06:57 PM
  4. Java project with multiple classes
    By trakke in forum New To Java
    Replies: 1
    Last Post: 04-28-2011, 08:16 PM
  5. java question on classes & objects
    By joe98 in forum New To Java
    Replies: 16
    Last Post: 04-08-2011, 09:45 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts