Course Handouts

ex1.java Simple example showing basic Java program structure
ex2.java Java variables, assignment and simple types
ex3.java Java expressions, operators and precedence
ex4.java Input using the Scanner class
ex5a.java
ex5b.java
Examples demonstrating Java control structures (if statement, while loop)
forexamples.java Some simple for loop examples
ex5c.java
ex5d.java
Examples demonstrating Java for loop (compare to ex5a.java and ex5b.java)
ex6.java
ex6b.java
Using Java switch and some output formatting
ex7.java Static methods, parameters and local variables
ex8.java Java reference types
ex9.java Data encapsulation, objects and methods
ex10.java
IntCircle.java
Simple example of a class
PlayList.java
Song.java
PlayListTest.java
songs.txt
More complex class example (refer back to this when needed)
FileTest.java Simple demo of Java text files
ex11.java
ex11.txt
Simple intro to Java arrays and more text files
ex12a.java More on Java arrays, references and searching
ex12b.java
Scores.java
Arrays as instance variables, resizing arrays, shared data vs. separate copies of data, private methods
ResizeDemo.java Demonstration of resizing an array
ArrayL.java
ArrayLb.java
ArrayLists and some of their abilities, and issues with sharing references within an ArrayList
ex13.java Two-dimensional arrays
ex14.java
SortInt.java
Simple sorting with SelectionSort and InsertionSort
BinarySearchDemo.java Binary Search example
ex15.java
MyInteger.java
Using wrapper classes and parsing integers
ex16.java Using the Character class
StaticDemo.java Simple demo of using static variables
ex17.java
SuperClass.java
SubClass.java
Subby.java
Simple example of inheritance
ex18.java
RationalNumber.java
MixedNumber.java
MixedNumber2.java
Inheritance vs. Composition
ex19.java Method overloading (ad hoc polymorphism)
OverrideDemo.java
MyAList.java
SortAList.java
Method overriding
ex20.java Demonstration of subclassing polymorphism in Java
ex21.java Demonstration of abstract classes in Java (compare to ex20.java)
ex22.java
Laughable.java
Booable.java
Intro. to interfaces in Java
ex23.java
SortAll.java
Generic access in Java
ex23T.java
SortAllT.java
Safer generics with parameterized types and methods
ex24a.java
ex24b.java
ex24b2.java
ex24b3.java
ex24c.java
ex24d.java
Intro to simple graphical components in Java
Counters.java Using JPanels to subdivide a window
Counters2.java Extending JPanel to encapsulate data
(compare to Counters.java)
ex25.java Intro. to Java Exceptions
MiniCalcTwo.java
DoMathInt.java
DoMathIntCheck.java
DoMathIntCheck2.java
Exceptions within GUIs; writing new Exception classes
recursion.java Intro. to recursion
Additional Handouts (FYI)
ex26.java Comparing binary and text files
ex27a.java
ex27b.java
PlayListSerial.java
SongSerial.java
Object input and output streams and Serializable objects
ex28.java Intro. to Data Structures concepts
CS-0401 Lectures Dr. Ramirez Lectures. Lots of contents. Mandatory readout.
reading text files code
Java Arrays Everything you need to know about Java arrays (well, most of it)
Assignment #3 Sample A JavaFXML sample code on how to use GridPane and FileChooser needed for assignment #3. Import this zip file into NetBeans IDE, run it and study its source code. Adapt the source code as necessary in your own code.
Source Code used
in lectures (from
Textbook)
This zip file contains all the source codes shown in my lectures, referenced in the power point slides. After unzipping this file, check on each specific chapter the .java file that you are looking for. I will post a video over this weekend to show how to migrate these source code into a NetBeans project, so you can run them).
Video Lectures Download this program into your computer, then create a MS Windows shortcut in the desktop. The short cut must have the following property

“<JAVA_HOME>\bin\java.exe” -jar C:\Users\ferreipb\Documents\NetBeansProjects\CS_0004_Course_Video\dist\CS_0004_Course_Video.jar

where <JAVA_HOME> should be the path of your Java JDK installation, e.g.,:

“C:\Program Files\Java\jdk1.8.0_92\bin\java.exe” -jar C:\Users\ferreipb\Documents\NetBeansProjects\CS_0004_Course_Video\dist\CS_0004_Course_Video.jar