Java – Introduction to OOPS

Application:

  • Programming Languages and Technologies are used to develop applications.
  • Application is a collection of Programs.
  • We need to design and understand a single program before developing an application.

Program Elements: Program is a set of instructions.Every Program consists,

  1. Identity
  2. Variables
  3. Methods
  • Identity:
    • Identity of a program is unique.
    • Programs, Classes, Variables and Methods having identities
    • Identities are used to access these members.
  • Variable:
    • Variable is an identity given to memory location.
    • Variable is a Named Memory Location
    • Variables are used to store information of program(class/object)
SyntaxExamples
  datatype identity = value;  String name = “amar”;
int age = 23;
double salary = 35000.00;
boolean married = false;  
  • Method:
    • Method is a block of instructions with an identity
    • Method performs operations on data(variables)
    • Method takes input data, perform operations on data and returns results.
SyntaxExample
returntype identity(arguments)
{
      body;
}
int add(int a, int b)
{
      int c = a+b;
      return c;
}

Scroll to Top