CMPSC 56 Study Guide - Midterm Guide: Subtyping, Local Variable, Multiple Inheritance
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.