CSC207H1 Lecture Notes - Lecture 3: Instance Variable, Call Stack, Memory Address

85 views3 pages
5 Oct 2016
School
Course
Professor

Document Summary

Example: public class circle { private string radius; Each object of the radius class has its own copy of the instance variable radius. Otherwise, if we define a constructor for a class, then there is no need for the compiler to provide a default constructor. This this is an instance variable in java that we get without declaration. It contains a value, which is the memory address of the object whose method has been called. (i. e. the instance method of the object) Methods must contain a return type form: return (insert expression here: if there is no return expression at the end of a method, nothing gets returned. Accessibility levels (must be specified: public accessible from anywhere, private only accessible within the class, none (package protected) accessible within package, protected accessible within package and subclasses. Some methods have parameters, or arguments to be passed in.

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

Related Questions