0% found this document useful (0 votes)
4 views

JAVA-oops

Java
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

JAVA-oops

Java
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

JAVA

1. WHAT IS JAVA?

* Independent ,open source ,object oriented programming language


* garbage collection-if the variable we declared is not used throughout the
program..then the variable will get deleted from the memory.
* to develop mobile applications,web based applications etc..

2. what are the advantages of oops?

* modularity - breaking the whole program into smaller modules to reduce


code complexity
* encapsulation - binding of data and variables(eg:tablet)
* abstraction - hiding the unnecessary details(eg:driving a car)
* polymorphism -many forms(eg.person)
TYPES OF POLYMORPHISM
* runtime polymorphism(method overloading-same class )
* compile time (method overriding-parent class and child
class)
*Inheritance - A class inherits all the properties of another class(super
class and sub class)
code reusability

3.datatypes
* primitive - int,char,string,byte.float,boolean(stored in the
stack)
* non primitive- String ,arrays,objects (Stored in the heap)

4.ASCII values
Numerical representation of characters,symbols in the computer memory
0-9 =48-57
A-Z = 65
a-z =97

5. constructor
used to initialize the objects
automatically called when the object is created
has the same name as class name
THIS KEYWORD - refers to the current instance of the class
used to differentiate the variables
SUPER KEYWORD - used to call the parent class constructor, variable or
method.

6. CONTROL STATEMENTS
1. CONDITIONAL -if ,if-else etc..
2. LOOPING - for ,while - entry controlled loops (condition is checked
first)
do-while -exit controlled loop(even if the
condition gets false the loop will execute the statement once)
3. BRANCHING - break,continue,return

7.class - blueprint or a template


object - instance of the class(used to access the methods and variables of the
class)
methods -static and instance methods
static - no need to create objects
memory is allocated only once

8.ACCESS MODIFIERS
public -anywhere in the program
private-only within the method
protected -only in that class and child class

You might also like