CMPSC 56 Study Guide - Midterm Guide: Subtyping, Local Variable, Multiple Inheritance

53 views5 pages
26 Oct 2017
School
Course
Professor

Document Summary

Write-once/run-anywhere: (1) create source document, written in java (2) run document through a source compiler, which checks for syntax errors (3) compiler creates new document coded into java bytecode (4) Java virtual machine (jvm) is the abstract computing machine that enables a computer to run a java program. Code structure: source file with one class definition, class with one or more methods, and method(s) In java, you cannot treat ints as if they were booleans. Bytecodes are the java equivalent of machine language instructions. Use java -version to figu(cid:396)e out (cid:449)hat (cid:448)e(cid:396)sio(cid:374) of ja(cid:448)a (cid:455)ou(cid:859)(cid:396)e (cid:396)u(cid:374)(cid:374)i(cid:374)g on any given system. Instance variables are things an object knows about itself. A class tells the jvm how to make an object of that type. Two classes needed to create an object: (1) class for the type of object (2) class to test the new class (contains main() method) The dot operator is used to access methods and variables of an object.

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

Related Documents