寻找在Java中实现定义多维数组的方法,每个索引都是不同的类型
像这样的东西...
下面的“价值”和“活动”是相关的。但缺乏这样的结构,它们是独立声明的。
final String[] values = new String[]{
"Config",
"Linking Twitter & Facebook",
"Facebook Direct",
"Twitter Direct",
"Action Bar (Profiled)",
"Sharing",
"Comments",
"Likes",
"Views",
"Entities",
"User Profile (Profiled)",
"Actions (User Activity)",
"Subscriptions",
"Location",
"Init",
"Tools"
};
final Class<?>[] activities = new Class<?>[]{
AuthButtonsActivity.class,
FacebookActivity.class,
TwitterActivity.class,
ActionBarActivity.class,
ShareActivity.class,
CommentActivity.class,
LikeActivity.class,
ViewActivity.class,
EntityActivity.class,
UserActivity.class,
ActionActivity.class,
SubscriptionActivity.class,
LocationActivity.class,
InitActivity.class,
ToolsActivity.class
};
它应该被声明为这样的......如果java有支持......
Array<String, Class>[][] valueClasses =
final Array<String, Class>[][] valueClasses = new Array<String, Class>[][]{
{ "Config", AuthButtonsActivity.class },
};