CPS 109 Lecture Notes - Lecture 1: Primitive Data Type, Default Constructor, Java Bytecode

195 views10 pages

Document Summary

Objects are not written directly in java: classes are a blueprint of an object, class compiles java bytecode. Public void methodname naming convention: void = no return type, methodname lowercase always. Methods contain statements: instructions for an object. Method call: object. methodname(arguments); always put arguments except in some void methods, then use empty parentheses eg where the method just prints out using system. out. println nothing is passed into it. Whitespace in java: compiler is insensitive to it, so it is skipped over. Case-sensitivity: compiler is case-sensitive, reads lowercase and uppercase as separate. A class declaration for a subclass, can be done using extends . Eg: public class mountainbike extends bicycle{ : here mountainbike inherits all fields and methods of bicycle + has its own fields. & methods: *a class can only extend/subclass 1 parent, *a class can implement more than 1 interface*

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents