Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

JAVA PROGRAMMING NOTES PART 2

Rating
-
Sold
-
Pages
18
Uploaded on
12-01-2024
Written in
2022/2023

notes have topics Java OOPs Concepts Object in Java Constructor in JAVA Constructor Overloading

Institution
Course

Content preview

JAVA PROGRAMMING NOTES
PART 2

, MODULE 2




Java OOPs Concepts

Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is
a methodology or paradigm to design a program using classes and objects. It simplifies the
software development and maintenance by providing some concepts:

o Object o Class o
Inheritance o
Polymorphism o
Abstraction o
Encapsulation


Object
Any entity that has state and behavior is known as an object. For example: chair, pen, table,
keyboard, bike etc. It can be physical and logical.


Class
Collection of objects is called class. It is a logical entity.


Inheritance
When one object acquires all the properties and behaviours of parent object i.e. known as
inheritance. It provides code reusability. It is used to achieve runtime polymorphism.


Polymorphism
When one task is performed by different ways i.e. known as polymorphism. For example: to
convince the customer differently, to draw something e.g. shape or rectangle etc.

In java, we use method overloading and method overriding to achieve polymorphism.

Another example can be to speak something e.g. cat speaks meaw, dog barks woof etc.




Abstraction
Hiding internal details and showing functionality is known as abstraction. For example: phone
call, we don't know the internal processing.In java, we use abstract class and interface to achieve

, A java class is the example of encapsulation. Java bean is the fully encapsulated class because all
the data members are private here.


Advantage of OOPs over Procedure-oriented programming language
• 1)OOPs makes development and maintenance easier where as in Procedure-oriented
programming language it is not easy to manage if code grows as project size grows.

• 2)OOPs provides data hiding whereas in Procedure-oriented programming language a
global data can be accessed from anywhere.

• 3)OOPs provides ability to simulate real-world event much more effectively. We can
provide the solution of real word problem if we are using the Object-Oriented
Programming language.




Java Naming conventions


Name Convention

class name


should start with uppercase letter and be a noun e.g. String, Color, Button, System, Thread etc.




interface name should start with uppercase letter and be an adjective e.g. Runnable, Remote, ActionListener etc.

method name


should start with lowercase letter and be a verb e.g. actionPerformed(), main(), print(), println() etc.


variable name should start with lowercase letter e.g. firstName, orderNumber etc.

should be in lowercase letter e.g. java, lang, sql, util etc.

Written for

Institution
Course

Document information

Uploaded on
January 12, 2024
Number of pages
18
Written in
2022/2023
Type
Class notes
Professor(s)
Sajad
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
owaiswani

Get to know the seller

Seller avatar
owaiswani islamic university of science and technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
15
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions