Skip to main content

Posts

Object Oriented Programming In Java(OOPS)

1. Data Hiding  2. Abstraction 3. Encapsulation 4. Tightly Encapsulated Class   5. IS-A Relationship(Inheritance)  o Multiple inheritance  o Cyclic inheritance 6. HAS-A Relationship  o Composition o Aggregation 7. Method Signature 8. Polymorphism o Overloading  Automatic promotion in overloading o Overriding  Rules for overriding  Checked Vs Un-checked Exceptions  Overriding with respect to static methods  Overriding with respect to Var-arg methods  Overriding with respect to variables  Differences between overloading and overriding ? o Method Hiding 9. Static Control Flow o Static control flow parent to child relationship o Static block 10. Instance Control Flow o Instance control flow in Parent to Child relationship 11. Constructors o Constructor Vs instance block  o Rules to write constructors o Default constructor o Prototype of default constructor o super() vs this():  o Overloaded constructors o Recursive...
Recent posts

polymorphism

Polymorphism : Polymorphism refers to the ability of OOPs programming languages to differentiate between entities with the same name efficiently. This is done by Java with the help of the signature and declaration of these entities. For Example: // Java program to demonstrate Polymorphism // This class will contain // 3 methods with same name, // yet the program will // compile & run successfully public class Sum { // Overloaded sum(). // This sum takes two int parameters public int sum(int x, int y) { return (x + y); } // Overloaded sum(). // This sum takes three int parameters public int sum(int x, int y, int z) { return (x + y + z); } // Overloaded sum(). // This sum takes two double parameters public double sum(double x, double y) { return (x + y); } // Driver code public static void main(String args[]) { Sum s = new Sum(); System.out.println(s.sum(10, 20)); System.out.println(s.sum(10, 20, 30)); System.out....

Object Oriented Programming Concept in Java

Object Oriented Programming Concept in Java  Object-oriented programming:  Object-Oriented Programming or OOPs refers to languages that uses objects in programming. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. OOPs Concepts 1. Polymorphism 2 . Inheritance 3.Encapsulation 4.Abstraction 5.Class 6.Object 7.Method 8.Message Passing polymorphism
Constructor in java : >A constructor is a special member method which will be called by the jvm automatically(implicitly)  whenever an object is created for placing placing our own values instead of placing default values. PURPOSE: *the purpose of constructor concept is initialize an object. *Advantages of constructor:  1.constructor Eliminates default values .  2.constructor eliminates in calling the ordinary method explicitly. *Rules/properties of constructor: 1.constructor will be called automatically by the jvm whenever an object is created. 2.the name of constructor must be similar to class name. 3.constructor should not return an return type,even void also.(if we write any return type then it will be    treated as ordinary method). 4.constructor modifier should not be static because constructor will be called each and every time whenever an object is created .java does not contain static constructors. 5.constructor will not be participated i...

Addition or Sum of 2x2 matrix using Arrays in java

We know that arrays are different types, as usual one dimensional array, two dimensional array, three and multi (mxn) dimensional arrays. In two dimensional arrays we need 2x2 array. A 2x2 matrix is a rectangular often square array of numbers having 2 columns and 2 rows, or expressions which can be evaluated to numbers. The dimensions m x n refer to the number of rows (m) and columns (n) respectively. We can declare the one dimensional array as: int[] myArray = {0,1,2,3}; and two dimensional array looks like this: int[][] myArray = { {0,1,2,3}, {3,2,1,0}, {3,5,6,1}, {3,8,3,4} };        this array size is 4X4. Here in our program we are using 2X2 array only. Let us take two arrays named as A(2X2) and B(2X2), then add these two arrays. The resultant array(matrix) named as C(2X2). A general formula shown below notice that the indices match for the elements that combine, and that matrix addition and subtraction is commutative; e.g (A + B = B + A...

What is mean by software?

A Software is a collection of programs which are made for performing some specific operation.     According to industry standard software are classified into 3 types they are 1.System software 2.Application software 3.Internet software 1.System software:                             there are 3 aims which are a]Developing the functionality of Hardware devices(driver developement).      ex: printer scanner etc. b]Developing Real time operating system(WinOS,Unix,Linux,MACOS).       in order to fullfill system software we use following languages      ex:c,ALP. 2Application Software:                   aim is to develope software for organization.    It is basic now we see OOPS concepts 1]class 2]Object 3]Data Encapsulation 4]Data Abstraction 5]Inheritance 6]Polymorphism ...