1. inheriting class should implement the abstract method
2. Abstract classes offer default functionality for the subclasses
3. Abstract class cannot be instantiated
4. Can have fields declared
Back
Primitive types
Front
Data types that are not objects
(Boolean,byte,short,int,float,double)
Back
primitive variables,local variables are stored and methods
Front
in Stack
Back
If no constructor is provided
Front
Default constructor creates empty object structure without initialized values.
Object properties are null
Back
StackTrace
Front
a report of the function calls made by a program during debugging.
Back
HashMap contains key
Front
map.ContainsKey("Item");
Back
Component
Front
class that has attributes with member methods. Member methods may use attributes to fullfill business logic
Back
Interface name convention
Front
Names usually starts with "Can" or ends with "able"
Back
When to use composition?
Front
in case when class wants to use only few behaviours
Back
Pojo Plain Old Java Objects
Front
ordinary Java object that not bound by any special restriction
Back
Java beans
Front
class that contains only attributes with getters and setters
Back
valueOf()
Front
Converts primitive data type to String
Back
Generic
Front
Classes, Interfaces, methods in which type of data is specified as parameter.
Allows to create single class that automatically works with different data type.
Generics works only with object
Back
Byte code
Front
machine language of JVM
Back
composition
Front
Has-A relation.
class will hold other classes reference as attributes
Back
HashMap iterate over values
Front
for(String i: map.values()) { ... }
Back
StringBuffer
Front
Mutable string object that can be change
Back
equals() vs ==
Front
Back
Can constructor be inherited?
Front
No, constructor cannot be inherited.
Back
Upcasting
Front
Assigning an object of a derived class type to a variable of an ancestor class
Back
Varargs ( Arbitrary Number of Arguments )
Front
zero or more String objects arguments.
he argument(s) passed in this way is always an array
public void myFunc(String... s);
Back
Collection cannot contain
Front
Primitive types, instead use Class wrappers ( Integer, Double)
Back
Functional Interface
Front
Interface containing only one method and often used with Lambdas.
Marking annotation:
@FunctionalInterface
public interface IntToLongFunc() {
long applyAsLong(int value);
}
storing Key & value pairs
HashMap<String, Integer> items = new HashMap<>()
Back
String object
Front
stored in string constant pool
Back
method overloading
Front
The ability to define two or more different methods with the same name but different method signatures.
Back
Interface
Front
1. interface methods cannot have a body only signature
2. When you implement interface you must use it
3. Cannot contain instance variables, but, they can contain public static final variables
4. Allows you to separate the definition of a method from the inheritance hierarchy
5. Can extend another interface
Back
Multiple Constructors
Front
A class can have multiple constructors, as long as their signature (the parameters they take) are not the same.
Back
3 tier architecture
Front
MVC
1. Presentation Layer (UI, View)
2. Business Logic Layer
3. Data Layer (Model)