COMPSCI 2S03 Lecture Notes - Lecture 14: Object-Oriented Programming, Default Constructor

70 views2 pages

Document Summary

Types of java statements: sequential, selectional/conditional, loops/repetition, none of the above, all of the above. Identifiers: unique names given to class, variables, methods, constants. Identifiers are user defined names given to do something (declaration and initialization, using data types) Primitive data types, user defined data types, e. g. int x. Identifiers should not be keywords (reserved words that have special meaning in the programming language, e. g. while, for, do. However, scanner is not reserved, it"s a class name that can be redefined! Identifiers must start with letters, a-z, a-z, but can include numbers and underscores. Conditional statements - if this condition is true, the body will be executed. We can use break, continue to control the flow. Method calls to change the flow (jump to another method) Elementary data (single data), e. g. name, height, age. Class -> object (an instance of a class, called encapsulation) User defined classes: attributes (defined by properties) and methods (behaviours)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents