Exercise 1 Declare a constant of type int called SIZE and initialize it to value 10 Declare two int arrays of size “SIZE” Assume that those int arrays.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 3 More Syntax; Working with Objects.
Advertisements

CPSC 388 – Compiler Design and Construction
ITEC 320 Lecture 3 In-class coding / Arrays. Arrays Review Strings –Advantages / Disadvantages Input –What two methods are used? Conditionals Looping.
Fields, Constructors, Methods
Grouping objects Iterators. Iterator and iterator() Collections have an iterator() method. This returns an Iterator object. Iterator has three methods:
Objects First With Java A Practical Introduction Using BlueJ Improving structure with inheritance 2.0.
Using interfaces Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling How would you find the maximum.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 4.0.
Grouping Objects Arrays and for loops. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Fixed-Size Collections.
Well-behaved objects 4.0 Testing. 2 Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main concepts to.
Grouping Objects 3 Iterators, collections and the while loop.
String Concatenation (operator overloading) 3.0.
Designing Classes How to write classes in a way that they are easily understandable, maintainable and reusable.
Well-behaved objects Improving your coding skills 1.0.
Testing and Debugging. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling (Reminder) Zuul Assignment Two.
1 Lecture Today’s topic Arrays Reading for this Lecture: –Chaper 11.
Grouping Objects 2 Collections and the for-each loop Collections and the while loop.
Repetition Structures: For Loop Constants CSC 1401: Introduction to Programming with Java Week 5 Wanda M. Kunkle.
STREAM STREAM A software process The Mañana Principle The Mañana Principle Don’t try to everything at once! Static Methods Static Methods Stateless Utility.
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Arrays and ArrayLists.
Objects First With Java A Practical Introduction Using BlueJ Grouping objects Collections and iterators 2.0.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Objects First With Java A Practical Introduction Using BlueJ Supplementary Material for Java
OOPDA Intro 5.0. Topics Website and Syllabus Rowan VPN and H:drive BlueJ application and projects Programming Style (Appendix J) Javadoc (Appendix I)
Testing. Have you contacted your project members lately?
Objects First With Java A Practical Introduction Using BlueJ Well-behaved objects 2.1.
1 COS 260 DAY 15 Tony Gauvin. 2 Agenda Questions? 6 th Mini quiz Today –Chapter 6 Assignment 4 posted –Due Nov 9 Capstone progress reports are due –Brief.
Objects First With Java A Practical Introduction Using BlueJ Designing classes How to write classes in a way that they are easily understandable, maintainable.
1 COS 260 DAY 12 Tony Gauvin. 2 Agenda Questions? 5 th Mini quiz –Chapter 5 40 min Assignment 3 Due Assignment 4 will be posted later (next week) –If.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability © 2017 Pearson Education, Inc. Hoboken,
Review. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Objects and Classes Objects and Classes –State.
Coming up ArrayList ArrayList vs Array – Declaration – Insertion – Access – Removal Wrapper classes Iterator object.
Objects First with Java
Objects First with Java CITS1001 week 4
Java Arrays and ArrayLists COMP T1 #5
Comp1004: Loops and Arrays II
Chapter 1 Introduction to Java
Fixed-sized collections
Chapter 2 Java in 30 minutes
Functional Processing of Collections (Advanced)
Objects First with Java CITS1001
Objects First with Java A Practical Introduction using BlueJ
COS 260 DAY 9 Tony Gauvin.
Objects First with Java
Arrays, For loop While loop Do while loop
COS 260 DAY 13 Tony Gauvin.
Arrays ICS 111: Introduction to Computer Science I
Objects First with Java
Example Problems for Exam#2 (covers chapters 5, 6, 7, 8, 9)
More about inheritance
COS 260 DAY 10 Tony Gauvin.
COS 260 DAY 18 Tony Gauvin.
More On Enumeration Types
Java Programming Arrays
COS 260 DAY 8 Tony Gauvin.
Announcements & review
COS 260 DAY 15 Tony Gauvin.
COS 260 DAY 16 Tony Gauvin.
CS2011 Introduction to Programming I Arrays (I)
COS 260 DAY 11 Tony Gauvin.
CISC181 Introduction to Computer Science Dr
Collections and iterators
Creating cooperating objects
Comp1202: Inheritance I Super and Sub-classes.
Improving structure with inheritance
Collections and iterators
Presentation transcript:

Exercise 1 Declare a constant of type int called SIZE and initialize it to value 10 Declare two int arrays of size “SIZE” Assume that those int arrays have been initialized. Write a for loop that iterates “SIZE” number of times and multiplies the numbers in each array. For example, the first element in first array should be multiplied with the second array. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling

We have to deal with errors Early errors are usually syntax errors. The compiler will spot these. Later errors are usually logic errors. The compiler cannot help with these. Also known as bugs. Some logical errors have no immediately obvious manifestation. Commercial software is rarely error free. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling