CDN 4101 Study Guide - Midterm Guide: Static Variable, Type Signature, Javac
Document Summary
Double, float, short, long, byte, int, boolean, character. Static and final, static indicates an attribute or method to belong to the class. Make a class with a main method (public static void main(stirng[] args){}) Open command line, javac filename. java which compiles the english java language to machine language which the jvm is able to read and run. Java filename is than called in order to run the file with the jvm. In order for the jvm to be able to read the file, the main method must be public because that is where the code is driven, otherwise the code wont compile. Because, in java a function or variable in class in inaccessible until an object is created from the class, but the "main" function is supposed to run at startup(without. So the "main" is declared public as well as static so that it can be accessed outside class & without even an object is created.