関数を使っていくつかのクラスを実装する必要があります。これらの関数はいくつかのエラーコードを返す必要があります。私は通常、エラーコードで公開列挙型を宣言するために使用し、それは私のために働きます(例えばC#で)が、enumはAndroid(パフォーマンス)このコードについてどう思いますか?
public class myClass_1
{
public final class myErrorCodes
{
public static final int ERROR_1 = 0x01;
public static final int ERROR_2 = 0x02;
public static final int ERROR_3 = 0x03;
public static final int ERROR_4 = 0x04;
public static final int ERROR_5 = 0x05;
public static final int ERROR_6 = 0x06;
}
public int Function_1(int a,int b)
{
//do something here...
return myErrorCodes.ERROR_1;
}
}