• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/67

Click to flip

67 Cards in this Set

  • Front
  • Back
What can identifiers starts with?
letter, _ or $
how many classes can a souce code file have?
only ONE public class. name must match file name.
what comes first package or import statement?
package then import
can a file have more than one non public file?
yes
what are the three access modifiers?
public, protected, private
name the access levels
public, protected, default, private
what access levels can classes have?
public, default
who can see a default class?
classes in the same package
who can see a public class?
a class from any package
name class modifiers
final, abstract or strictfp
can a class be abstract and final?
no
can a final class be subclassed?
no
can an abstract class be instansiated
no
what does having a single abstract method mean for a class?
the whole class must be declared abstract
who must implement an abstract classes abstract methods?
the first concrete subclass
what is an inteface?
a contract for what a class can do. no implementation
can an interface extend another interface?
yes, it can extend many.
can a class implement multiple interfaces?
yes but only one class.
is an interface implicity abstract?
yes
can an interface have a constant?
yes, they are implicity public static and final
can a class implementing an interface declare any new checked exceptions for an implementation method?
no
can a class implementing an interface declare any new runtime exceptions for an implementation method?
yes
can a class implementing an interface not declare the exceptions of the method in the interface?
yes
can an interface extend a class?
no
can a class implementing an interface be abstract?
yes
what are methods and instances variables known as?
members
what access level can members have?
all four: public, protected, efault, private
who can access public members?
all classes in all packagages
can a subclass inherit a public superclass member
yes
can a subclass inherit a public superclass member if its in another packages?
yes
what is 'this.'
refers to current object
who can access private members?
only code in the same class
can private members be inherited?
no
who can access default memebers?
classes in the same package
who can access protected memebers?
classes in the same packages and subclasses in any package
what access modifers can a local variable ahve?
none
can a local variable be final?
yes
do local variables get default values?
no, must be initialised first
can final methods be overidden in a subclass?
no
is the throws clause of an abstract method mandatory?
no
can a class be synchronized?
no
what can have synchronized modifier?
method, code block only
what access levels can a synchronized method have
all
can a sychnronized method be declared final?
yes
can abstract methods be private?
no
can abstract methods be final?
no
what is a var-arg paramater
a param tha accepts from zero to infinte num of args
what is the syntax of a var-arg param
doStuff(int... x);
can a method have multiple var-args params?
no
if a method has multiple params where does the var-arg have to come?
last
what acess levels can an instance variable have?
public, private, default, protected
what other modifiers can an instance variable have?
final, transient, volatile
NOT abstract, synchronized, native or strictfp
can a local variable have the same name as aninstance variable?
yes, it's calling shadowing
what are some properties of a final variable?
- cant be reinitialized once assigned a value
- can't refer to a diff object once assigned
- must be initialized before constructor completes
can the properties of a final obj be changed?
yes
is an array an object?
yes
what can ararys hold?
primitives or objects
how many copies of a static variable are there?
one, all instances share it
can static methods access non-static members?
no
what is an enum?
a list of constant values assigned to a type
is an enum an int
no
can an enm be declared inside a class?
yes
can an enum be declared inside a meothd?
no
what can an enum contain?
constructors, methods, variable and constant class bodies
can enum constructors have arguments?
yes
can an enum have an overloaded constructor?
no
what is MyEnum.values()
returns an array of MyEnum's values