下の2つの方法がどのようにArrayList
を作成するには、次のとおりです。ArrayListを正しく作成するには?
List<String/*or other object*/> arrList = new ArrayList();//Imports List, ArrayList
ArrayList<String/*or other object*/> arrList = new ArrayList();//Imports just ArrayList
違いは何ですか?どちらの方法を使うべきですか?
Formerでは、_abstraction_を活用できます。 – rocketboy
明らかな答えは別として、あなたは輸入について心配するべきではありません。実行時のパフォーマンスには影響しません。 –
[プログラムとインターフェイスすることは何であるか]を見てください(http://stackoverflow.com/questions/383947/what-does-it-mean-to-program-to -an-interface) – Pshemo