Chapter1 Flashcards
Name the two aspects of Java identifiers.
Legal identifiers
Oracle’s java code conventions
What does it mean to have legal identifier?
rules that the compilers uses to determines if the name is legal
What is Oracle’s Java Code Conventions
it is oracle’s recommendation for naming ur variables, classes and methods.
Name the legal identifier for naming identifiers.
- Start with letter, $ or _
- Cannot start with digits.
- after that can have alpha numberic characters, $ or _
- case sensitive
- no limit to the number of characters an identifier can contain
Name the 50 java keywords
a - abstract,assert b- boolean, break, byte c- char, class, case, const, catch d- double,do, defualt e- enum, extends, else f- for, final, finally g- goto, i - int, if, implements, import, instanceof, interace n- navtive, new p - private, protected, public,, package r - return s- switch, stringfb, super, synchronized, short t - throws, transient, try, this v- volatile, void w-while
What is the naming convention for interfaces?
methods?
Runnable
Serializable -add able
getUserName.
so camelCase
Can main method be over loaded?
Yes it can be
What is static import?
so if you do import static java.lang.System.out;
all you gotta do is
out.println(“Hello”);
What are the nested class?
inner classes
Name the two types of modifiers
access modifiers
nonaccess modifiers :
strictfp, final , abstract
What does it mean for a class A to have access to class B?
So A extends B.
create an instance of B
and A can access certain methods and variables..
strictfp
can only be used with a method or class not never with a variable.
Create an abstract method. Whats the difference?
public abstract void goFast(); //this is the difference.
public void getFast(){};
Good to know about abstract keyword
If u have a single array method, that class must be abstract
Will this compile?
final void bounce();
No because final and abstract cannot be used at once