SEN1001 · Programlamaya Giriş (Java)

Introduction to Programming (Java)

Variables, operators, conditions, loops, methods, arrays and first classes.

Textbook: Paul Deitel, Harvey Deitel, Java: How to Program, 9th Edition, 2011, Pearson, ISBN-10: 0132575663, Edition: 10th

  1. Week 1
    Introduction
    • How a Java program is compiled and runFrom source code to bytecode, from the JVM to the screen: the javac/java chain, the anatomy of a first program and the three kinds of errors. On the midterm it shows up as fill-in-the-blank and short output questions.
  2. Week 2
    Introduction to Java Applications /Elementary Programming
    • Variables, primitive types and printfDeclaring variables, the eight primitive types, char arithmetic, casting and formatted output with printf. This is where you learn the difference between 7 and 7.0 in output questions.
    • Input with Scanner, String basics, ++ and +=Reading numbers and text from the keyboard, String methods (length, charAt, substring, indexOf, equals) and the increment/compound assignment operators. The first lines of writing questions and the sneakiest part of tracing are here.
    • Operators: /, % and precedenceInteger division, the remainder operator and Java's order of operations. Half of the “What is printed?” questions come from here.
  3. Week 3
    Control Statements: Part 1
  4. Week 4
    Control Statements: Part 2
  5. Week 5
    Methods
  6. Week 6
    Arrays
    • Arrays: declaring, traversing, passing to methodsCreating one-dimensional arrays, default values, length, index errors, enhanced for, sum/max/average and an array going to a method as a reference. The cornerstone of every exam after the midterm.
  7. Week 7
    Arrays II
    • Array algorithms and ArrayListLinear search, counting, reversing in place, the difference between a real copy and an alias, shifting and checking whether sorted; then ArrayList, the list whose size can change, and its methods. On the exam it comes both as tracing and as writing short methods.
  8. Week 8
    Review + Midterm
    • Midterm review: weeks 1-7A one-table summary of all the midterm topics from the compile chain to ArrayList, the traps that cost the most points, exam tactics and mixed exam-style questions.
  9. Week 9
    Multidimensional Arrays
    • Two-dimensional arrays (2D arrays)Tables made of rows and columns: creating them, m.length versus m[r].length, traversing with nested loops, row/column sums, the diagonal, transpose and ragged arrays. On the final it comes as tracing and method writing.
  10. Week 10
    Introduction to Classes and Objects
    • Classes and objects: fields, methods, get/setA class is a template, an object is an instance made from that template. Creating objects with new, instance variables, the dot operator, private fields and get/set methods, reference variables and null. The biggest topic of the final starts here.
  11. Week 11
    Classes and Objects II
    • Constructors, UML class diagrams, arrays of objectsConstructors that prepare the object the moment it is born, the default constructor rule, constructor overloading, reading and drawing a UML class diagram, keeping objects in an array and in an ArrayList. The skeleton of the final writing questions.
  12. Week 12
    Classes and Objects: A Deeper Look
    • this, static members, final constants and toStringthis when a parameter shadows a field, this(...) chaining constructors, static fields shared by all objects, final values that do not change and toString for printing an object readably. The favorite of 'what is printed' questions on the final exam.
  13. Week 13
    Classes and Objects: A Deeper Look II
    • Composition, enum and passing references to methodsAn object of another class as a field of a class (has-a), enum for fixed sets of values, and the consequences of object references going to a method as a copy: a method can change the object but cannot turn the caller's variable into another object.
  14. Week 14
    Case Study
    • Case study: a step-by-step gradebook (GradeBook)We combine all the pieces of the semester in one program: the Student class (array field, average, letter grade), the GradeBook class (ArrayList, top student, passing count, search), a printf report and a star histogram. A rehearsal for the final writing questions.