CISC 1115
Modern Programming Techniques
Lecture 0
Review & Overview
What You Should Have Learned in 1115
Java Program Structure
import
class
boilerplate
main
method
- program development: compilation, execution (interpretation)
- compilation / logic / runtime errors
Primitive Types
int
, double
, boolean
, char
Literals, Constants, Variables
Imperative programming
The programming style to which you were introduced in CISC 1115, in which the step-by-step actions
of a program are specified. This is accomplished by executing actions such as assigning and retrieving
values to/from variables; erforming calculations and invoking methods;
making decisions on which action to take using conditionals; and repeating actions using iterators.
- arithmetic operators:
+
, -
, *
, /
, %
- assignment:
=
, +=
, -=
, etc.
- increment/decrement:
++
, --
- relational operators:
==
, r!==
, <
, etc.
- logical operators:
||
, &&
, !
- casts:
(double)
, etc.
- conditionals:
if
/ ? :
/ switch
- iteration:
for
/ while
/ (do while
)
Methods
- defining, calling
- signatures
- overloading
- arguments/parameters, return values
- method decomposition
- A standard approach to organizing code by repeatedly breaking up of larger tasks into smaller ones
which are then turned into methods.
Stream and File I/O
System.out
, PrintStream
Scanner
hasNext
, hasNextLine
, hasNextInt
, hasNextDouble
next
, nextLine
, nextInt
, nextDouble
- prompts for keyboard (interactive) input
Arrays
- creating
- accessing/modifying using subscripts
length
field
Standard Java Classes
String
length
: determines the number of characters in a string
+
(string concatenation) : builds up strings from other strings (or objects or primitive values)
indexOf
: searches for strings in other strings
charAt
a : extracts single characters from strings
substring
: extracts strings from other strings
Character
Random
nextInt
, nextInt(bound)
, nextDouble
, nextBoolean
Math
You may have learned a substantial number of the following:
Techniques
- divisibility
- swapping
- min / max
- counts / totals / accumulating
- input using header value / trailer value / eof
- sorting / searching
- input using header, trailer, and eof
- sentinels
- first-time (initialization) and last-time (shutdown) logic
- finding adjacent and arbotrary dupicates
- counting adajcent and arbotrary occurrences
- wrapper and delegation methods
What You Will Be Learning in This Class
- Classes and Objects
- A way of organizing code (methods) and data (variables) into
logically related entities (objects)
- Exception Handling
- A powerful way of handling exceptional situations, in particular errors
- Object-Oriented Programming
- Extending the power of classes and objects
- Encapsulation
- Inheritance
- Polymorphism
- Recursion
- A powerful approach to expressing algorithms
- Collections
- Classes that act as containers of objects
- Threads
- The ability to have an app have multiple 'simultaneous' executions
- Graphic User Interfaces (GUI)
- A programming style in which the user drives the actions of the program
- Network Programming
- Inter-machine communication
- (Unix, Vi, Java Development Environment)
- An introduction to software development in the operating system of choice in the
commercial (enterprise) world