CSC207H1 Lecture Notes - Static Variable, Instance Variable, Class Variable

61 views1 pages
11 Jan 2013
School
Course
Professor

Document Summary

Types are critical: python uses duck typing , doesn"t need to declare type for variable. Types are checked at runtime, and any object with the appropriate capalities (methods) is legal: java tries to catch errors early, so it checks types before the program is run. This means that some code that could work if the program was run will be ruled illegal. Require casting when pulling items of out object array. Defining methods: must have a return type declared. Use void if there is nothing return: to leave a method: Parameters: you pass what"s in the box. If a reference type you are passing a reference (just like python) If a primitive, you are passing the value (python can"t do anything like this: this has crucial implications. You must be aware of whether you are passing a primitive or object. Classes: instance variables and static variable. Howmany is a static or class variable.

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