Humanity Expired February 2016

Symbol could not be found

I try to call the Accumulator class in my program, but the symbol cannot be found.

public static void main(String[] args)
{
    Login c = new Login();
    Accumulator d = new Accumulator();
    ^                   ^
}

Answers


RAnders00 February 2016

It depends on what the Accumulator class is from. Did you write it yourself? Then you can either use your IDE or look into the Accumulator class to find out its package. For example, if you had this class:

package com.myapp;

public class Accumulator
{
    // some code here
}

You would then have to declare an import statement in the class you want to use Accumulator, like this:

package com.myapp.other.package;

import com.myapp.Accumulator;

public class OtherClass
{
    public static void main(String[] args)
    {
        Login c = new Login();
        Accumulator d = new Accumulator();
    }
}

Post Status

Asked in February 2016
Viewed 2,474 times
Voted 14
Answered 1 times

Search




Leave an answer