Java – Android programming issues

Hello, I am a programmer who uses C / c# / VBS almost completely. Now I have just entered the Android development world. I have encountered several problems, and I seem to be unable to find the answer / I don't want to watch the lengthy tutorial video, so I think I will ask here and get a quick answer

I don't know if this is the best way, so I'm willing to accept any suggestions

I need to provide some custom data containers for my program. Suppose I want an 'achievement' class, so I can have their arrays!

Now in c# I will do something similar

public class Achievment  
{
    bool locked;
    string achName;
    string achSubName;

    public Achievement(string name, string subname)
    {
        //ctor code goes here
    }
}

This is not everything I need, but this is the idea of data layout I want. However, when I try to create a custom class in eclipse, my grid about "public type achievements must be defined in their own files?" I write this in the. Java file of the application... Should I go elsewhere? I'm confused. Basically Java can also be Swahili... I like my intuitive c# layout!

Basically, I want to store my data separately from my UI. When I generate an "achievement list", it will view the achievement array of the current user and fill it from there. Good or bad?

Thank you for any answers that are not redirected to the tutorial form!

resolvent:

You must remove the public modifier from the class (so its visibility will be the default level - only visible from the package where your application class resides) or you need to move the class to the achievement.java file

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>