У меня это имя файла Invictus.txt с содержаниемНе читает конкретный файл
Invictus
William Ernest Henley (1849–1903).
Out of the night that covers me,
Black as the pit from pole to pole,
I thank whatever gods may be
For my unconquerable soul.
In the fell clutch of circumstance
I have not winced nor cried aloud.
Under the bludgeonings of chance
My head is bloody, but unbowed.
Beyond this place of wrath and tears
Looms but the Horror of the shade,
And yet the menace of the years
Finds and shall find me unafraid.
It matters not how strait the gate,
How charged with punishments the scroll,
I am the master of my fate:
I am the captain of my soul
и я использую
Scanner input = new Scanner(new File(fileName));
но
input.hasNext
возвращается нуль, его работы отлично с другими файлами !!!
Вы ссылаетесь на полный (абсолютный) или относительный путь к файлу? – Mureinik
@Mureinik, Если файл не найден, будет выдано 'FielNotFoundException'. Возврат null - это еще одна проблема. – Masudul
Файл находится в поиске Исключение не выбрасывается, но он не читает содержимое! – user2864175