Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSCI 335 - Software Development: Exception Handling, Pattern Matching, and Linked Lists - , Study notes of Software Engineering

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

Pre 2010

Uploaded on 08/05/2009

koofers-user-obe-1
koofers-user-obe-1 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCI 335 Software Development
Chain of Responsibility
November 16, 2007
CS 335 1
pf3
pf4

Partial preview of the text

Download CSCI 335 - Software Development: Exception Handling, Pattern Matching, and Linked Lists - and more Study notes Software Engineering in PDF only on Docsity!

CSCI 335 — Software Development

Chain of Responsibility

November 16, 2007

Exception handling

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); }

Linked lists

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; } }