Building Blocks Flashcards
what is object?
An object is a runtime instance of a class in memory
what are the two main elements of class?member of class?
methods and variables
What is the keyword?
calls a word with special meaning
meaning of public and class keywords?
public-- class can be used by other classes class- is created class with name "toy class"
what is the void?
it is a return type and no need to return value for that method
what is the method signature?
a full declaration of method
public int numberVisitors(int month)
int-return type,
numberVisitor-name of the method
(int month)- parameter
comment types
//--one line, /* * * /*-- multiple line comment /** * * . /*- javadoc comment
does it proper class
class toy { String str; }
does it proper class?
public class phone{ } class smartPhone{ String name; }
What is the main() method?
A main() method is the gateway between the startup of a Java process, which is managed by the Java Virtual Machine (JVM), and the beginning of the programmer’s code.
java file extension
.java
bytecode extension?
.class
the correct main method parameters?
String[] args, String args[] or String… args;
how could be create an objects?
by using constructors—- Random random=new Random();