Unformatted text preview:

CMSC 131 Intro to Object Oriented Programming I Ekesh Kumar Prof Nelson Padua Perez Fall 2019 University of Maryland http www cs umd edu class fall2019 cmsc131 030X Last Revision July 29 2020 Contents 1 Monday August 26 2019 Logistics Preliminaries 2 Wednesday August 28 2019 Our First Program Introduction to Variables Integer Types Floating Point Variables Boolean Types String Types Comments Debugging 3 Friday August 30 2019 Immutability of Strings String Concatenation String Comparison Introduction to Scanners Conditional Statements Logical Operators 6 6 6 7 7 7 7 9 10 10 11 11 12 12 12 12 14 16 17 Ekesh Kumar Prof Nelson Padua Perez Intro to Object Oriented Programming I Fall 2019 4 Wednesday September 4 2019 More on Conditionals 5 Friday September 6 2019 Compound Assignment Uninitialized Variables Constants While Loops 6 Monday September 9 2019 Do While Loops Variables Blocks and Scopes 7 Wednesday September 11 2019 For Loops Nested Loops 8 Friday September 13 2019 Scope Error Expressions Introduction to Methods 9 Monday September 16 2019 More on Methods Precedence Short Circuiting 10 Wednesday September 18 2019 Casting Numeric Types Floating Point Calculations 11 Monday September 23 2019 Pass By Value StringBu ers Returning Values Software Development 12 Wednesday September 25 2020 13 Friday September 27 2020 14 Monday September 30 2020 Introduction to Classes Constructors 2 18 18 20 20 20 21 22 24 24 25 26 26 27 30 30 30 31 34 34 35 36 37 37 37 39 39 40 40 42 44 45 46 46 48 Intro to Object Oriented Programming I Fall 2019 Ekesh Kumar Prof Nelson Padua Perez 15 Wednesday October 2 2019 16 Friday October 4 2019 17 Monday October 7 2019 equals method The this Keyword Breaking and Continuing Exceptions Introduction Exception Propagation Throwing Exceptions 18 Wednesday October 9 2019 Finally Blocks String Methods Math Methods 19 Friday October 11 2019 Immutable Classes Ternary Operator The Switch Statement 20 Monday October 14 2019 Arrays Copying Arrays 21 Wednesday October 16 2019 Resizing Arrays Arrays of References Arrays as Parameters Returning Arrays 22 Friday October 18 2019 Array Initialization Lists Arrays in Classes 23 Monday October 21 2019 Privacy Leak Copying Objects 24 Wednesday October 23 2019 Recursion 3 51 51 52 54 54 56 56 56 58 59 60 60 61 62 64 64 64 65 68 68 69 71 71 72 73 73 75 75 75 79 79 80 85 85 Ekesh Kumar Prof Nelson Padua Perez 25 Friday October 25 2019 Intro to Object Oriented Programming I Fall 2019 Abstraction and Encapsulation Libraries 26 Monday October 28 2019 More Recursion Examples Tail Recursion Common Recursion Problems Recursive Array Methods Zero Length Arrays 27 Wednesday October 30 2019 28 Friday November 1 2019 29 Monday November 4 2019 30 Wednesday November 6 2019 31 Friday November 8 2019 32 Monday November 11 2019 More on Two Dimensional Arrays Model View Controller ArrayLists Interfaces 101 The Comparable Interface 106 Polymorphism 107 Wrappers 107 Method Overloading 108 33 Wednesday November 13 2019 getClass and instanceof 110 Introduction to Inheritance 111 34 Monday November 18 2019 Early and Late Binding 117 Inheritance versus Composition 117 The Iterable Interface 118 35 Wednesday November 20 2019 88 88 88 89 89 90 91 92 93 93 94 96 98 98 99 99 101 106 110 117 119 4 Intro to Object Oriented Programming I Fall 2019 Ekesh Kumar Prof Nelson Padua Perez 36 Monday November 25 2019 Object Binding 120 Command Line Arguments 121 37 Monday December 2 2019 Multiple Inheritance 123 Dynamic Systems and State Transition Diagrams 123 120 123 5 Ekesh Kumar Prof Nelson Padua Perez Intro to Object Oriented Programming I Fall 2019 1 Monday August 26 2019 Logistics This is CMSC 131 Object Oriented Programming I This course is an introduction to Java and it does not assume any programming knowledge The course homepage is at https www cs umd edu class fall2019 cmsc131 030X Course announcements are sent out through Piazza Projects are worth 26 of our grade quizzes and exercises are worth 16 the three midterms are worth 30 and the nal exam is worth 28 All projects are due at 11 30 p m on the speci ed day in the project description However you can submit up to 24 hours afterwards with a 12 penalty If you submit a project multiple times the highest scoring project gets graded All lectures are recorded and posted to Panopto Preliminaries We ll start this course o by introducing some important terminology Firstly we ll brie y discuss two levels of software 1 Operating systems manage the computer s resources they are typically run as soon as a computer is turned on Some examples include security related software and process management tools 2 Applications are programs that users interact directly with These are typically explicitly run by the user This can include word processors games music software or java programs Programs are typically executed with the help of compilers Compilers are programs used for translating other programs source code that you write into assembler or machine code There are many compilers out there but we only need one An alternative way to execute programs is through the use of interpreters which take source code as input and execute the source directly However these are much slower than compiled programs Debuggers are based on interpreters since they support the step by step execution of source code 6 Ekesh Kumar Prof Nelson Padua Perez Intro to Object Oriented Programming I Fall 2019 2 Wednesday August 28 2019 Our First Program Today we ll look at our rst Java program 1 public class FirstProgram public static void main String args System out println Terps are awesome 2 3 4 5 How does this program work There are three primary components to this program 1 The rst line uses the keywords public class to indicate that everything that follows is part of a new class that is being de ned FirstProgram is an identi er that we use to name the class The entire class de nition is contained between an opening curly brace and a closing curly brace 2 The second component to this program is the main method In the Java programming language every ap plication is required to have a main method which is declared as public static void main String args We will see exactly what each of these keywords mean later on 3 Finally the last part of this program consists of the statements to be executed In this program we only have one statement System out println Hello World This line outputs Hello World followed by a new line on the screen Most but not all


View Full Document

UMD CMSC 131 - Notes

Documents in this Course
Set #3

Set #3

7 pages

Exam #1

Exam #1

6 pages

Exam #1

Exam #1

6 pages

Notes

Notes

124 pages

Load more
Download Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?