Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Java OOP Basics
Rating: 4.4 out of 5(582 ratings)
14,181 students

Java OOP Basics

Learn the basics of Object Oriented Programming in Java with Class, Object, Constructors, Inheritance etc
Created bySunil Joseph
Last updated 9/2020
English

What you'll learn

  • Basics of Object Oriented Programming in Java
  • Class, Objects, Constructors, Method Overloading
  • Inheritance, Overriding Members, A Basic Banking Application

Course content

2 sections11 lectures1h 58m total length
  • Course Contents0:47

    Course Contents of Java OOP Basics that can be covered in 2 Hrs time frame by Udemy fro Free courses

  • Introduction to OOP with Class & Objects15:50

    Object oriented programming is a programming concept based on the concept of objects.

    The main aim of the OOP is to bind data and functions together.

    Object Oriented Programming has advantages over other programming concepts like Procedure Oriented Programming (POP).

    Java is an object oriented programming language.

    OOP provides many concepts such as encapsulation, inheritance, abstraction, polymorphism etc.

    OOP is mainly based on Class & Objects.

    Class: 

    As per Object Oriented Analysis and Design (OOAD) many definitions are given for a class; in that two well known definitions are :

    1) Class is a Concept

    2) Class is a blue-print

    Object:

    An object is a real instance or living instance of a class.

    This means that an object is created from the definition of the class and is loaded in heap memory.

    Any number of objects can be created for a class

    Each object has its own memory space that can hold independent data values.

    An object consists of :

    1) State : represents each data (value) of an object.

    2) Behavior : represents the functionality of an object such as deposit(), withdraw() etc in a banking application.

    3) Identity : the unique ID of an object. It is used internally by the JVM to identify each object uniquely.

  • Practicals | Part-014:59
  • Practicals | Part-027:24
  • Constructors13:36

    Constructors

    1. A Constructor is a special type of method in a class

    2. The name of the constructor method is same as that of the class name

    3. Constructor method should not have an explicit return type.

    4. A constructor is used for initalizing the member datas of an object

    5. A Constructor method will be executed automatically whenever an object of a class is created

    6. When an object is created, atleast one constructor gets executed

    7. Constructors are of two types: (a) Default Constructor - compiler defined constructor (b) Parameterized Constructor

    8. The compiler will create a construtor at the time of compilation, only if there is no user defined constructors are available in the class definition

    Difference between constructor and a normal method of a java class

    1) Constructor is used to initialize the state of an object.

    Method is used to expose behaviour (business logic) of an object.

    2) Constructor must not have explicit return type.

    Method must have return type.

    3) Constructor is executed implicitly when an object of a class is created.

    Method should be called explicitly, then only it will gets executed.

    4) The java compiler provides a default constructor if there is no constructor defined in the class.

    A normal Method is not created by compiler in any case.

    5) Constructor name must be same as the class name.

    Method name may or may not be same as class name.

  • Overloading Methods16:20

    Overloading Methods

    • In a class if there exists more than one method with the same name but with different signatures are known as overloading methods or method overloading

    • The name of the method together with parameter details is known as method signature

    • The method calling signature should be matching with method definition signature

    • In a class it is not possible to have more than one method with the same signature

    • There are two ways to overload the method in java

    1) By changing number of arguments

       void add(int x, int y){   }

       void add(int x, int y, int z){   }


    2) By changing the data type of arguments

       void add(int x, int y){   }

       void add(int x, float y){   }

  • Overloading Constructors15:40

    In a class if there exists more than one constructor with different signatures is known as overloading constructors.

    "this" Keyword

    "this" is a keyword of Java acting as the reference to the current object inside a Java class method.

    "this" keyword can be used to access current class method and instance variables

    "this" keyword can be used to access current class constructor,and is called as constructor chaining.

    Call to this() must be the first statement in constructor if constructor chaining is required.

    "this" keyword can be passed as an argument in the method call.

    "this" keyword can be used to return the current class instance.

    etc

  • Banking Application19:55

Requirements

  • Basic of Java Programming
  • Basic Working Knowledge of any Java IDE

Description

This course is designed to give you the real understanding of Object Oriented Programming in  Java Programming Language. By the end of this 02 Hrs course, you will understand Object Oriented Programming in Java extremely well. You will get to know know about the role of OOP in application development, getting the actual concepts of Class, Object, Constructors, Overloading methods, Overloading Constructors, use of "this" keyword, Inheritance, Overriding members and the use of "super" keyword. You will study the OOP by implementing a simple Banking Application

Who this course is for:

  • All those who want to understand Object Oriented Programming in Java