14a-recursive_programming_2

14a-recursive_programming_2 - CSE 143 Lecture 14 (A) More...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 143 Lecture 14 (A) More Recursive Programming reading: 12.2 - 12.3, 12.5 slides created by Marty Stepp http://www.cs.washington.edu/143/
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Exercise • Write a method crawl accepts a File parameter and prints information about that file. –I f the File object represents a normal file, just print its name. –I f the File object represents a directory, print its name and information about every file/directory inside it, indented. cse143 handouts syllabus.doc lecture_schedule.xls homework 1-sortedintlist ArrayIntList.java SortedIntList.java index.html
Background image of page 2
3 File objects •A File object (from the java.io package) represents a file or directory on the disk. creates File object representing file with given name File( String ) returns whether this object represents a directory isDirectory() returns a File[] representing files in this directory listFiles() whether this file exists on disk exists() returns file's name
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/04/2011 for the course CSE 143 taught by Professor Sr during the Spring '08 term at University of Washington.

Page1 / 5

14a-recursive_programming_2 - CSE 143 Lecture 14 (A) More...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online