PIC 20A: Principles of Java Language with Applications
About
In this Java course, students focus on inheritance and polymorphism. These concepts are applied to build graphical user interfaces from scratch and to understand exceptions, a mechanism by which many programming languages communicate errors.
General Course Outline
Basics of JAVA
- the static keyword in C++, HelloWorld.java
- variables of primitive data type, conversions
- Math, overloading static methods, control flow, varargs
- arrays, new, objects and reference variables, Strings,
- classes
- fields and methods
- creating instances, variables as references
- constructors, overloading, this, instance initializer blocks
- static fields, static methods, factory methods, static initializerblocks
- packages, importing, static importing
- member access modifiers (public, private, package-private)
- class access modifiers (public, package-private)
Inheritance and Polymorphism
- Inherited fields, inherited methods, super to call a constructor, super to call a method
- Polymorphism, widening conversions, explicit narrowing conversions, compile-time and run-time considerations
- abstract classes, abstract methods, polymorphism in this context, final classes, final methods, interfaces
- constructor chaining, instanceof, toString
- hiding versus overriding, access modifiers (public, package-private, protected, private), private methods are not inherited or overridden.
Autoboxing and Unboxing, Inner Classes
Graphical User Interfaces (GUIs)
- JFrame, setTitle, setDefaultCloseOperation, add, setSize, setVisible
- JLabel, GridLayout, setLayout, JOptionPane.showMessageDialog
- JButton, getText, setText
- addActionListener, ActionListener, actionPerformed, ActionEvent, getSource
- JPanel, setPreferredSize, paintComponent, repaint
- Graphics, Color, Graphics2D
- MouseListener, Timer
Exceptions
- RuntimeException, try-catch, Throwable, finally
- throw, Exception, checked exceptions, throws clause
- Error
Streams
- InputStream, OutputStream, read, write, close, IOException
- FileInputStream, FileOutputStream, FileNotFoundException, PrintStream
- ByteBuffer, ByteOrder
- Reader, Scanner
Expected Grade Scheme and Homework Assignments
- Homework: 15%
- Midterm 1: 25%
- Midterm 2: 25%
- Final: 35%
PIC 20A instructors are required to assign at least four homework assignments.