SlideShare a Scribd company logo
1 of 20
ICOM4015/CIIC4010
Exam Review #1
Reference: Big Java Early Objects, 5th Edition by Cay Horstmann
Chapter 1: Introduction
 1.1 Computer Programs
 A computer program is a sequence of instructions and decisions.
 Programming is the act of designing and implementing computer programs.
 1.2 The Anatomy of a Computer
 The central processing unit (CPU) performs program control and data processing.
 Storage devices include memory and secondary storage.
 1.3 The Java Programming Language
 Java is a high-level programming language.
 The name of the class must be the same from the source file.
 Java is case-sensitive.
Let’s see an Example
From Source Code to Running Program
Chapter 1: Introduction
 1.5 Analyzing your First Program
 Each source file can have at most one class with the exception of inner classes (discussed
later on in the course).
 1.6 Errors
 A compile-time error is a violation of the programming language rules that is detected
by the compiler.
 A run-time error causes a program to take an action that the programmer did not intend.
Chapter 2: Using Objects
 2.1 Objects and Classes
 Objects are entities in your program that you manipulate by calling methods.
 A method is a sequence of instructions that accesses the data of an object.
 A class describes a set of objects with the same behavior.
 2.2 Variables
 A variable is a storage location with a name.
 Names for the variables can be any identifier.
 All identifiers must start with either a letter( a to z or A to Z ) or currency character($) or
an underscore.
 After the first character, an identifier can have any combination of characters.
 A Java keyword cannot be used as an identifier.
 Identifiers in Java are case sensitive, foo and Foo are two different identifiers.
 Variables must be declared and initialized before used.
Chapter 2: Using Objects
 2.3 Calling Methods
 Overloaded VS Overriden
 int f(int a)
 int f()
 void f()
 void f(int a)
 2.4 Constructing Objects
 Constructors are special kind of methods with two major differences
1. It doesn’t have any return type (not even void).
2. The name of the constructor is the same name of the class.
 Stack and Heap
 Details in next slide.
Object Construction
Chapter 2: Using Objects
 2.5 Accessor and Mutator methods
 An accessor method does not change the internal data of the object on which it is
invoked. A mutator method changes the data.
 2.6 The API Documentation
 Demonstration
 2.8 Object References
 Details on next slide.
Object Reference
Chapter 3: Implementing Classes
 3.1 Instance variables and encapsulation
 Each object has its own properties.
 Encapsulation is the process of hiding implementation details and providing methods for
data access.
 Private, public and protected.
 Basic structure of a class in next slide.
Basic Structure of a Class
Chapter 3: Implementing Classes
 3.6 Local Variables
 Local variables are declared in the body of a method.
 Scope of local variables and parameters.
 Local variables must be initialized.
 Instance variables are initialized to a default if not initialized explicitly.
 Arguments VS Parameters.
The this reference
Chapter 4: Fundamental Data Types
Constant Declaration
Chapter 4: Fundamental Data Types
 4.2 Arithmetic
 If both expressions in a division are integers the result will be an integer.
 Math class
 Casting
 Static
 4.3 Input and Output
 Scanner class
 Printf
 4.5 Strings
 Strings are sequences of characters.
 String class in the API.
 Concatenation
 Escape sequences (n, t, , ’, ”)
Chapter 5: Decisions
Chapter 5: Decisions
 5.1 If Statement
 If, else if , else VS if, if, if
 Conditional operator
condition ? value1 : value2
 Switch
 5.2 Comparing values
 When comparing objects use the equals method.
 For floating-point values use Math.abs(x - y) < 1E-14
 Don’t confuse = with ==
 Short circuit && and ||

More Related Content

What's hot

What's hot (20)

5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java
 
C# interview questions
C# interview questionsC# interview questions
C# interview questions
 
Finite state system or finite automata
Finite state system or finite automataFinite state system or finite automata
Finite state system or finite automata
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
 
Interface
InterfaceInterface
Interface
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++
 
Dot net introduction
Dot net introductionDot net introduction
Dot net introduction
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Class diagram java
Class diagram javaClass diagram java
Class diagram java
 
ITFT - Java
ITFT - JavaITFT - Java
ITFT - Java
 
4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading
 
Interfaces in java
Interfaces in javaInterfaces in java
Interfaces in java
 
Java interfaces
Java   interfacesJava   interfaces
Java interfaces
 
Structure of java program diff c- cpp and java
Structure of java program  diff c- cpp and javaStructure of java program  diff c- cpp and java
Structure of java program diff c- cpp and java
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
A COMPLETE FILE FOR C++
A COMPLETE FILE FOR C++A COMPLETE FILE FOR C++
A COMPLETE FILE FOR C++
 
Java notes
Java notesJava notes
Java notes
 
Class and object
Class and objectClass and object
Class and object
 

Similar to ICOM4015 CIIC4010 Exam Review #1

Similar to ICOM4015 CIIC4010 Exam Review #1 (20)

Java quick reference
Java quick referenceJava quick reference
Java quick reference
 
OOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdf
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Sdtl manual
Sdtl manualSdtl manual
Sdtl manual
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Java IO
Java IOJava IO
Java IO
 
Qb it1301
Qb   it1301Qb   it1301
Qb it1301
 
Java basic concept
Java basic conceptJava basic concept
Java basic concept
 
Java Unit 2(Part 1)
Java Unit 2(Part 1)Java Unit 2(Part 1)
Java Unit 2(Part 1)
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
Basics of Java
Basics of JavaBasics of Java
Basics of Java
 
Smart material - Unit 2 (1).pdf
Smart material - Unit 2 (1).pdfSmart material - Unit 2 (1).pdf
Smart material - Unit 2 (1).pdf
 
Smart material - Unit 2 (1).pdf
Smart material - Unit 2 (1).pdfSmart material - Unit 2 (1).pdf
Smart material - Unit 2 (1).pdf
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
 
17515
1751517515
17515
 
CHAPTER 3 part1.pdf
CHAPTER 3 part1.pdfCHAPTER 3 part1.pdf
CHAPTER 3 part1.pdf
 
Question bank unit i
Question bank unit iQuestion bank unit i
Question bank unit i
 
Java14
Java14Java14
Java14
 
Java unit 7
Java unit 7Java unit 7
Java unit 7
 

Recently uploaded

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

ICOM4015 CIIC4010 Exam Review #1

  • 1. ICOM4015/CIIC4010 Exam Review #1 Reference: Big Java Early Objects, 5th Edition by Cay Horstmann
  • 2. Chapter 1: Introduction  1.1 Computer Programs  A computer program is a sequence of instructions and decisions.  Programming is the act of designing and implementing computer programs.  1.2 The Anatomy of a Computer  The central processing unit (CPU) performs program control and data processing.  Storage devices include memory and secondary storage.  1.3 The Java Programming Language  Java is a high-level programming language.  The name of the class must be the same from the source file.  Java is case-sensitive.
  • 3. Let’s see an Example
  • 4. From Source Code to Running Program
  • 5. Chapter 1: Introduction  1.5 Analyzing your First Program  Each source file can have at most one class with the exception of inner classes (discussed later on in the course).  1.6 Errors  A compile-time error is a violation of the programming language rules that is detected by the compiler.  A run-time error causes a program to take an action that the programmer did not intend.
  • 6. Chapter 2: Using Objects  2.1 Objects and Classes  Objects are entities in your program that you manipulate by calling methods.  A method is a sequence of instructions that accesses the data of an object.  A class describes a set of objects with the same behavior.  2.2 Variables  A variable is a storage location with a name.  Names for the variables can be any identifier.  All identifiers must start with either a letter( a to z or A to Z ) or currency character($) or an underscore.  After the first character, an identifier can have any combination of characters.  A Java keyword cannot be used as an identifier.  Identifiers in Java are case sensitive, foo and Foo are two different identifiers.  Variables must be declared and initialized before used.
  • 7.
  • 8. Chapter 2: Using Objects  2.3 Calling Methods  Overloaded VS Overriden  int f(int a)  int f()  void f()  void f(int a)  2.4 Constructing Objects  Constructors are special kind of methods with two major differences 1. It doesn’t have any return type (not even void). 2. The name of the constructor is the same name of the class.  Stack and Heap  Details in next slide.
  • 10. Chapter 2: Using Objects  2.5 Accessor and Mutator methods  An accessor method does not change the internal data of the object on which it is invoked. A mutator method changes the data.  2.6 The API Documentation  Demonstration  2.8 Object References  Details on next slide.
  • 12. Chapter 3: Implementing Classes  3.1 Instance variables and encapsulation  Each object has its own properties.  Encapsulation is the process of hiding implementation details and providing methods for data access.  Private, public and protected.  Basic structure of a class in next slide.
  • 14. Chapter 3: Implementing Classes  3.6 Local Variables  Local variables are declared in the body of a method.  Scope of local variables and parameters.  Local variables must be initialized.  Instance variables are initialized to a default if not initialized explicitly.  Arguments VS Parameters.
  • 18. Chapter 4: Fundamental Data Types  4.2 Arithmetic  If both expressions in a division are integers the result will be an integer.  Math class  Casting  Static  4.3 Input and Output  Scanner class  Printf  4.5 Strings  Strings are sequences of characters.  String class in the API.  Concatenation  Escape sequences (n, t, , ’, ”)
  • 20. Chapter 5: Decisions  5.1 If Statement  If, else if , else VS if, if, if  Conditional operator condition ? value1 : value2  Switch  5.2 Comparing values  When comparing objects use the equals method.  For floating-point values use Math.abs(x - y) < 1E-14  Don’t confuse = with ==  Short circuit && and ||