oops concept

class Person {
 void walk() {
  System.out.println(“Can Run….”);
 }
}
class Employee extends Person {
 void walk() {
  System.out.println(“Running Fast…”);
 }
 public static void main(String arg[]) {
  Person p = new Employee(); //upcasting
  p.walk();
 }
}

4
4
Awgiedawgie 440215 points

                                    OOP focuses on the objects that are
required to be manipulated instead of logic. 
- It makes development and maintenance easier
- It provides data hiding
- It provides ability to simulate real-world
- less memory and organized
- reusable

OOP language follow 4 principles:
1-ENCAPSULATION: We can hide direct access
to data by using private key and we can access
private data by using getter and
setter method. in my framework I have POJO
class which I use it when we need to represent
some data as Java object. So to that we need to 
create a Java class to represent it's data.
So in POJO class I use encapsulation and 
getter setter method to access them.

2-ABSTRACTION: It is a process of hiding
implementation details and showing only
functionality to the user. Abstraction lets
you focus on what the object does instead of how it does it.
In my framework I have created my
PageBase class as super
class of the all page classes. 
I have collected all common elements
and functions into PageBase class and
all other page classes extent PageBase class.
By doing so, I don't have to locate very
common WebElements and it provides
reusability in my framework.

3-INHERITANCE: It is used to define the
relationship between two classes. When a
child class acquires all properties and
behaviors of parent class known as inheritance.
Child class can reuse all the codes written
in parent class. It provides the code
reusability. in my framework I have
a TestBase class which I store 
all my reusable code and methods.
My test execution classes and 
elements classes will extend the
TestBase in order to reuse the code.

4-: POLYMORPHISM: It is an ability of object
to behave in multiple form. The most common use
of polymorphism is Java, when a parent class reference
type of variable is used to refer to a child
class object.
I use polymorphis almost everywhere
It is an ability of object to behave in multiple
form. The most common use of polymorphism is Java, when a
parent class reference type of variable
is used to refer to a child class object.
E.g.: WebDriver driver = new ChromeDriver();
JavaScriptExecuter js = (JavaScriptExecuter)Driver.getDriver;
TakeScreenshot screen = (TakeScreenshot)Driver.getDriver;
WebDriver driver = new ChromeDriver();

4 (4 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
who introduced oops concept all the basic oops concept with example oops concept with examples the complete object orientation in java basic oops explanation oops concept with example OOPs concept. Explain all concepts with example. why oops concept needed oops concept coding who invented oops concept what is the use of oops concept Object Orientation in Java 8 oops concept basic oops concept definition Explain briefly about oops concept. use of oops concept oops concept questions oops example basic oops concept application oops concept use concept is oops basic oops concept what oops concept what best describes oop oop which of the following is not an oops concept oops definition Basic concept of oops oops concept question java basics oops concepts how to learn oops concepts in java oop concepts with examples mosi important consepts in oop java what are oop concepts what is oop concept in java explain the concept of oops what is a oops concept oops concept java why java is called object oriented programming why java is object oriented programming different types of OOP strong DS concept and oops concept how to tell strong DS concept and oops concept oops 5 points concepts of oop What are the main OOPS concepts in java and explain one by one? oops features in java java oops concepts best explained what is connection of java with oops concepts java object oriented programming tutorial what are oops concepts oops concepts in java with example programs concept ooups objektum orientation java i work with oop concepts object oriented programming in java concepts which oops proeprty is the best oop of jsvs invlufr List out the object-oriented features of Java OOPS concept chart which concept of oops java object oriented programmming 4 oops concepts in java types of oops concepts oop core concepts java oop types object oriented programming examples java concepts of oops in java OBJECT-ORIENTED PROGRAMMING IN JAVA concepts in java how java is object oriented language basic features of oops in java example basic features of oops in java what is oop concepts what is oop concepts in java OOP examples in java oops concept. java programming oops concepts What are different object oriented concepts? what are different concepts of oop java oops programs oops properties complete oops concepts in java principles of oop java oops concepts oops conecpt in java what is oops java explain oop concepts and methods oops concepts with code what two oops concepts ar similar definition oops concept java key concepts oop features in java oops implementation in java oops with java oop concept JAVA Programming for Object Oriented Programming java oop concept oops cocet in java java basic concepts principles of oop in java implementation of oops in java explain oop concepts oop using java practicals main concepts in OOP fundamental oop concepts in java Java concepts java oop concept? object oriented programming in java object oriented programming javba java oops basic core java, java oop object oriented programming concepts java java oops concept JAVA OOP concept of oops oops concept in depth java oops concepts in java with example program oop java concepts oops concepts in detail this in oop java oops concept in detail java object oriented oops basic concepts basic concepts of oops java is oop? java opps concepts oops concepts in java with examples oop programming java oop progmming java java opps concept definations oops java concepts oop principles java how to improve java oop concepts all oops concept oop java codes example for a oops concept object oriented programming through java techprimer Java Oops object oriented concepts java programming concepts how to use complete concepts of object oriented programming in java aplication this in java oop list of methods in oops in java object oriented programming all concepts basic oops concepts in java java an oop java what is object oriented programming implementation of OOP in java oops concepts with examples oops structure in java oops basic code ij jaba simple object oriented design example java what is object oriented concepts oops concepts definitions in java what is oops concept in java java oops definition java oops concepts thoery object oriented programming java structure java oops concerpts explain oop concepts in java java oops concepts for experienced java with oops object oriented programming java topics object ofriented in java what are the oops concepts in java oops example in java java object-oriented programming oops concepts examples in java oop trong java what are concepts in java] oops types in java oopd java java core concepts java oop. object-oriented programming java java full object oriented programming basic object oriented programming concepts java oops example programs opp overviow java 5 pilars of oop java short notes on oops concept in java oops concepts in java in depth concept of oops with example oop programming principles java object oriented programming java important program examples JAVA OOD examples basic java oop program solved time what is core java and oop JAVA supports object oriented paradigm. oop principles java in code example java have oop concept?? object oriented programming java introduction to oops in java oop examples java object oriented programming using java oop concepts java oops in java with expamples oops concepts java examples of oop in java java oop ? what is an object oriented programming OOO in java java object oriented programming concepts oops concepts with examples in java what is oops in java oop all concepts is oops concepts required what is oops what is opps concept oops concept oop concepts java program to illustrate oops concepts what is object oriented programming how to practice java oops concept what is oops concept small java oops function all the terms in oop java signature object in java java what is oop java concepts java oop concepts object oriented programming concepts in java java concept oops concept in java oop java oops in java basic concepts in java oops java java oops java oops concepts java object oriented programming oop in java how to code java object based programming program concepts for java oops concepts in java what is Java OOPS oops concepts of java opps concepts of java java oop java oop concepts summary oop concepts in java what is oop in java
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source