Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my code for simply creating a file instance. But my output is File does not exist, which means that it's going through the

This is my code for simply creating a file instance. But my output is "File does not exist", which means that it's going through the catch block? I have PovertyData.txt in the sam folder as this program, so I am unsure why it does that

public static void main(String[] args){ File file = new File("PovertyData.txt"); //create file instance Scanner input = null; int lineNum = 0; ArrayList spopList = new ArrayList(); //initialize list of statepopulation PopProcess processor = new PopProcess(); try { input = new Scanner(file);//create instance of file scanner } catch (FileNotFoundException a){ System.out.println("File does not exist"); return; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

1. Why do people tell lies on their CVs?

Answered: 1 week ago

Question

2. What is the difference between an embellishment and a lie?

Answered: 1 week ago