Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q3. Write a program that searches for a specific file in a given folder and prints out the paths of all files in that folder

image text in transcribed

Q3. Write a program that searches for a specific file in a given folder and prints out the paths of all files in that folder with the given filename. If the file cannot be not found, your program should print a message "File cannot be found", where is the name of your file. Use recursion in your solution. public static void main(Stringt] args) find ( "Animal.java", ":/121/"); c:\121\HappyFarm\ve r-6 Animal . java c:\121 HappyFarm ver_7 \Animal.java SAMPLE RUN 2: public static void main (String[ args) ( find ("dummy.txt", "c:/121/") output: Cannot find dummy.txt Q3. Write a program that searches for a specific file in a given folder and prints out the paths of all files in that folder with the given filename. If the file cannot be not found, your program should print a message "File cannot be found", where is the name of your file. Use recursion in your solution. public static void main(Stringt] args) find ( "Animal.java", ":/121/"); c:\121\HappyFarm\ve r-6 Animal . java c:\121 HappyFarm ver_7 \Animal.java SAMPLE RUN 2: public static void main (String[ args) ( find ("dummy.txt", "c:/121/") output: Cannot find dummy.txt

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_2

Step: 3

blur-text-image_3

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions