DAY 1: Java Course Notes

 DAY 1: Java Course Notes



OOPS:

Object Oriented Programming Structure.

It is a method of implementation in which a program is organised as a collection of object, class and methods.


Class:

Collection of object and methods.


Object:

Run time memory allocation.


Method:

Set of actions to be performed.


4 Principles of OOPS:


  • Polymorphism

  • Abstraction

  • Inheritance

  • Encapsulation


Two Standard notation or coding standards:

JAVA: Developed


  1. Pascal notation:

  2. Camel notation.


Pascal Notation:

Each word of the first letter should be capital.

Eg. JavaTesting.

Followed in: project name, class name.


Camel Notation:

First word of first letter small remaining each word of first letter should be capitol.

Eg. javaTestingCourse

Followed in: object name, variable name, method name.


Project-> package-> class-> method -> object


Ant : Class

a() - m

b() - m



Object Creation:

ClassName objectName= new ClassName();


Ant z=new Ant();


Method Call:

objectName.methodName();

z.a();

z.b();



To Create a Project:

File-> new-> Java project-> project name( pascal notation)


To Create a Package:

src-> right click-> package -> packagename( test. , in. , .org. )


TO Create a class:

Right click on package name-> new-> class -> class name( pascal notation)


Eg. Program;


Package org.test.tcs;

// Class

Public class CourseDetails{

//1. Type the method name and press ctrl+space bar

// javaCourse - method name

Private void javaCourse(){

system.out.println(“java course”);

}

// 2. Press ctrl+space bar and then select the method from that

Public void aPICourse(){

system.out.println(“ API Course”);


}


// enter main - ctrl+space bar

Public static void main( string[] args)

{

// Object creation

CourseDetails c= new CourseDetails();

c.javaCourse();

c.aPICourse();

}







Assignment: Day 1


QUESTION 1:

------------

     Project   :EmployeeDetails

     Package   :org.emp

     Class     :Employee 

     Methods   :empId(),empName(),empDob(),empPhone(),empEmail(),empAddress()


Description:

Create an object for employee class and call above methods also follow the all coding standards.



QUESTION 2:

------------

   Project     :CompanyDetails

   Package     :org.company

   Class       :CompanyInfo

   Methods     :companyName(),companyId(),companyAddress()


Description:

Create an object for CompanyDetails class and call above methods also follow the all coding standards.



Comments

Popular posts from this blog

Inheritance and Type of Inheritance

Interview Topics for Software Testers and QA