Java Exam 1 Review

From Knowledge Kitchen
Jump to navigation Jump to search


Basic Computer Concepts

  • Desktop metaphor, paper paradigm
  • Text files vs. binary files
  • File names and extensions
  • Compressed files
  • Working directory
  • more basic computer concepts

Computer Science

Terminology

Java paradigm

  • Java source code
  • Byte code
  • Machine code
  • write-once, run anywhere

Command line

  • UNIX/Linux/Mac
  • Windows/DOS
  • javac, java
  • change directories
  • print current working directory
  • show listing of directories and files in current working directory

Number systems

Java basics

  • Variables, literals
    • Typing
  • Assignment
  • Expressions, statements
  • Boolean expressions and operators
  • Text input and output
  • Packages
  • Javadoc

Primitive data types

  • byte, short, int, long
  • float, double
  • boolean
  • char

Primitive data structures

  • array

Utility/helper/wrapper classes

  • Byte, Short, Integer, Long
  • Float, Double
  • Boolean
  • Char
  • Arrays

Java API

  • String
  • Scanner
  • Random
  • File
  • lots more
  • importing

Java control structures

  • If/else if/else
  • Switch/case
  • Loops
    • While loops
    • Standard for loops
    • Enhanced for loops (a.k.a. foreach loops)
    • Nested loops
  • Break, continue, flags
  • Methods/functions
    • Visibility
    • Arguments, parameters
    • Return values
    • Typing
    • Overloading

Comparing values

  • Primitive data types
  • Classes/objects
  • == operator
  • .equals() String method
  • .length vs .length()
  • modulus operator

Design patterns

  • Accumulator
  • Flag
  • Finding a needle in a haystack (i.e. finding a given value in an array)
    • linear search
    • binary search

Incrementing

  • var = var+1
  • var++
  • ++var

Problem solving

  • Reading comprehension
  • Flow charts
  • Pseudocode

Memory

  • Variable scope
  • Method parameters
  • Aliases

Strings

  • primitive or not primitive?
  • counting occurrences of a given word
  • reading strings from a file
  • toLowerCase()
  • toUpperCase()
  • indexOf()
  • split()
  • equals()
  • length()

Scanner

  • reading from the keyboard
  • reading from a file
  • looping through lines in a file
  • hasNextLine() and other hasNext... functions
  • nextLine() and other next... functions


What links here