Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はオブジェクトを持っています:
Object o = new Object[] {0, "key", 1234, "name"};
そこから特定のデータを取得するにはどうすればよいですか?
お気に入り:
o[2] //1234
また
o[1] //"key"
Eclipse で次のエラーが表示されます。
The type of the expression must be an array type but it resolved to Object.
o次のように定義する必要があります。
o
Object [] o = {0, "key", 1234, "name"};
その後、指定したとおりにアクセスできます。