Computer Science 1: Enumerations

Lesson 17 This is a simple one. Java will let you define an enumerated type- or limit all the possible values a variable can have. For example: The variable dinnerMenu is now restricted to the 5 options given by the type Entrees. It is considered type-safe, which means attempted use of a value that doesn’t …

Computer Science 1: Class Relationships

Lesson 16 The classes in a piece of software relate to each other in specific ways. 3 of these ways are dependency, aggregation, and inheritance. Dependency The dependency relationship is a “uses” relationship; where one class uses the other. This often happens when once class uses the methods of another.In general it’s best to have …

Computer Science 1: File Parsing and Exceptions

In this lesson we are going to take advantage of the fact that the scanner object is an iterator to process input from a source. We have a file in .inp format that contains a list of URLs for the program to dissect. The example program uses two scanners located within a nested while loop …

Design a site like this with WordPress.com
Get started