Preview

Object Oriented Programming Midterm

Better Essays
Open Document
Open Document
2088 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Object Oriented Programming Midterm
Java is simple such as it does not have any pointers, it has automatic memory allocation and garbage collector, and it has multiple inheritance with interfaces. Java is a platform-independent. Every Java source code is compiled to Java bytecode, which can be executed on any platform that has its own JVM without compilation.
Modifiers – certain reserved words that specify the properties of the data, methods, and classes and how they can be used.
Statements – a statement represents an action or a sequence of actions. Every statement in Java ends with a semicolon (;) ++i
Blocks – are used to group the components of the program, for example class blocks and method block
Classes – the class is the essential Java construct. Every Java program has at least one class. Programs are inside a class definition enclosed in blocks
The main method provide the control of program flow. The JVM executes the Java application by invoking the main method.
Rules to name a Java source file: * If a class has no modifier define for the keyword class, that class is thus default. The file name can be any. * If a class has public modifier, the file name must be the same as that class * If a class has main method, that class should be public
Therefore there must not be more than one public class in one file.
Identifiers – special symbols to name programming entities such as variables, constants, methods, classes, and packages. An identifier is a sequence of characters that begins with a letter, _, or $, then following with letters, digits, _, $. It must not be a reserved word, must not be true, false, or null, and can be of any length.

Command-line arguments…. java ClassName Hello World Hello ↲ World java ClassName “Hello World” Hello World java ClassName “First Num” 53 First Num ↲ 53
Expression – represents a computation involving values, variables, and operations that together evaluate a value system.out.println(++i);
Constants – represent permanent

You May Also Find These Documents Helpful

Related Topics