• 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

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/35

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

35 Cards in this Set

  • Front
  • Back

Objects

They can hold lots of different datatypes and perform actions using methods

Class

A blue print that defines how the object should look like



Lets us design our own objects.

Class

A blue print that defines how the object should look like

Static method

It doesn't need an object to run

Object state

Represents the data of an object

Object

Has all the characteristics of a class

Instance variable

A variable that is created inside of a class but outside of a method..

Instance variable

Doesn't get memory at compile time.. it gets memory at runtime

New Keyword

Allocates memory at runtime

Ways to initialize an object

By Reference variable



By method



By constructor

Anonymous object

Has no reference.. can be used at the time of object creation.. good for one time object use

Constructor

Similar to a method.. called when an instance of class is created

Rules of constructors creation

Must have the same class name


Mus not return any valye


Can not be static, abstract, final



It can have access modifiers

Default constructor

Created by java when an instance of class is created.. Doesn't have any parameters

Default constructor

Providers default value to objects. Like null or zero or etc..

Constructor overloading

Having more than one constructor with different parameter lists

Static variable

Used to refer to the common property of all objects like a company name.. it also gets memory only once in the class loading

Static method

Belongs to the class not the object.


Can be invoked without the need for creating a class instance.


Can access static data member and change its value.

Static method restrictions

Can not use non static data member or call non static method diretly.


Can not use this and super keywords.

Java static block

It is executed before the main method at the time of classloading

This

Reference varaible refers to current class

Inheritance

It's a mechanism in which one object inherits the characteristics of another object

Why use inheritance

For method overloading and code reusability

Types of inheritance in java

Single, multi and hierarchical

Method overloading

A class has multiple methods with the same name but different parameters

Method Overriding

If subclass (child class) has the same method as declared in the parent class, it is known as method overriding in Java.

Rules of method overriding

Must have the same name as the method in parent class.


Must have same parameter.


Must be an IS-A relationship

Super

Prefers to immediate parent class

Instance initializer block

Created when instance of class is created.


Invoked after the parent class constructor is invoked(super())

Final class

A class that can not be extended

Final variable

It can be only initalized once. Its value can not be changed

Final method

Methods that can not be overridden

Blank final variable

A final variable that is not initalized at the time of declaration

Polymorphism

A concept which u can perform single action in different ways

Abstraction

Hiding implementation details and showing only functionality to the user