☆★Java質問・相談スレッド184★★at TECH
☆★Java質問・相談スレッド184★★ - 暇つぶし2ch132:デフォルトの名無しさん
23/02/26 02:49:11.03 F7MFR7BvM.net
>>131
ありがとうございます。
try (Stream<Path> stream = Files.list(Paths.get(path))) {
File[] inputFiles = stream.filter(Files::isRegularFile).toArray(File[]::new);
Iterator<File> i = Arrays.asList(inputFiles).iterator();
while (i.hasNext()) {}}
のように、つなげて?書いてみたのですが
Exception in thread "main" java.lang.ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object[] to the type of the destination array, java.io.File
とエラーが表示されるので、もう少し調べてみます。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch