


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Code snippets and explanations for exception handling using the chain of responsibility design pattern, pattern matching using datatypes and functions, and linked lists using the node class in java, as taught in the csci 335 - software development course.
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!
Chain of Responsibility
November 16, 2007
try { Scanner file = new Scanner(new FileInputStream("operations.dat")); while (file.hasNext()) Class.forName(file.nextLine()); } catch (IOException ioe) { System.out.println("Couldn’t find file operations.dat"); System.exit(-1); } catch (ClassNotFoundException cnfe) { System.out.println("Couldn’t load operation " + cnfe.getMessage()); System.exit(-1); }
public class Node {
private int datum; private Node next;
public boolean contains(int item) { if (item == datum) return true; else if (next != null) return next.contains(item); else return false; } }