第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我在 println 中不斷收到“錯誤:找不到符號”

我在 println 中不斷收到“錯誤:找不到符號”

湖上湖 2022-06-30 18:05:18
我知道這是重復的,但其他人似乎都沒有幫助解決我的問題,而且我在 Google 上找不到任何有幫助的東西。這是我的代碼:import java.util.Scanner;class File_Scanner{        public static void read(){        try {            File credentials_file = new File("credentials.txt");            Scanner file_reader = new Scanner(credentials_file);            String[] users = new String[6];            int index_counter = 0;            while (file_reader.hasNextLine()) {                users[index_counter] = file_reader.nextLine();                index_counter++;            }            file_reader.close();        }        catch (Exception e) {          System.out.println(e.getClass());        }        System.out.println(users[0]);    }}我得到的錯誤是:File_Scanner.java:19: error: cannot find symbol        System.out.println(users[0]);                           ^  symbol:   variable users  location: class File_Scanner1 error感謝您所有的幫助!你們是最棒的!
查看完整描述

1 回答

?
慕姐4208626

TA貢獻1852條經驗 獲得超7個贊

users在 try 塊內定義,因此它不是 try 塊外的有效變量。



查看完整回答
反對 回復 2022-06-30
  • 1 回答
  • 0 關注
  • 161 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號