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
Summary

Summary Java module1

Rating
-
Sold
-
Pages
21
Uploaded on
28-02-2024
Written in
2023/2024

Java is a high-level programming language that is widely used for developing applications and software. It is an object-oriented programming language, which means that it is based on the concept of objects and classes. Object-oriented programming (OOP) is a programming paradigm that focuses on organizing code into objects, which are instances of classes. OOP concepts include encapsulation, inheritance, and polymorphism. Some features of Java include platform independence, object-oriented, simple, secure, robust, and dynamic. Constructors in Java are special methods that are used to initialize objects. They have the same name as the class and do not have a return type. Multiple Constructors in Java allow you to create multiple constructors in a class with different parameters. Constructor overloading is a concept where multiple constructors can have the same name but different parameters. Static methods in Java belong to the class rather than to any specific object. They can be called without creating an instance of the class. There are certain restrictions in Java, such as the inability to inherit multiple classes, lack of operator overloading, and restrictions on method overloading. Exception handling in Java allows you to deal with errors and exceptions that occur during program execution. Common runtime errors include null pointer exceptions, array index out of bounds, and arithmetic exceptions. Common Java exceptions include NullPointerException, ArrayIndexOutOfBoundsException, and ArithmeticException. Multiple catch statements in Java allow you to catch different types of exceptions in separate catch blocks. The finally block in Java is used to execute code that needs to be run regardless of whether an exception is thrown or not.

Show more Read less
Institution
Course

Content preview

MODULE 1
Apply object-oriented programming paradigms to
develop simple JAVA applications.
• Broadly the computer language can be classified into three categories
1.Assembly language
2. Machine language
3.High-level language
• Assembly Languages The assembly language is considered a low-level language for
microprocessors and many other programmable devices.
• The machine language is sometimes referred to as machine code or object code
which is set of binary digits 0 and 1. These binary digits are understood and read by a
computer system easily.
• The development of high-level language was done when the programmers face the
issue in writing programs as the older language has portability issues which mean the
code written in one machine cannot be transferred to other machines.
High-level language
• The high-level language is easy to understand and the code can be written easily
• Programs written are user-friendly in a high-level language.
• The other advantage of code written in a high-level language is the code is
independent of a computer system which means the code can be transferred to other
machines.
Object Oriented Language
• OOP is one of the high-level programming languages in which a program is divided
into objects.
• Using objects, the programmer can model real-world scenarios.
• An object is an instance of a class and has state and behavior.
• The state is the attributes, or data, whereas behavior is called a method.
• Languages: C++, Java, Python, PHP

OOP CONCEPTS/ CHARACTERISTICS OF OOP


• Objects:

*Any entity that has state and behavior is known as an object. For example, a chair, pen,
table, keyboard,
bike, etc. It can be physical or logical.
*An Object can be defined as an instance of a class.

,Example: A dog is an object because it has states like color, name, breed, etc. as well as
behaviors like

wagging the tail, barking, eating, etc.


• Classes:

*Class defines properties of objects linked to it

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

*A class can also be defined as a blueprint from which you can create an individual object.
Class doesn't consume any space.

• 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 abstraction.

• Inheritance:

*When one object used all the properties and behaviors of an existing object, it is known as
inheritance.

*It provides code reusability.

* It is used to achieve runtime polymorphism..

• Encapsulation:

* Data is secured with encapsulation, and binds the attributes and methods together.


*Data is secured with encapsulation,and binds the attributes and methods together.

*Binding (or wrapping) code and data together into a single unit are known as encapsulation.

*For example, a capsule, it is wrapped with different medicines.

• Polymorphism:

* With polymorphism, an object can function in multiple ways, or the ability to take more
than one form.

*Polymorphism is characterized by the phrase “One interface, multiple methods”.

, * Examples: Method overloading and method overriding.
• Dynamic binding:

*Binding refers to the linking of a procedure call to the code to be executed in response to the
call.

*Dynamic binding means that the code associated with a given procedure call is not known
until the time of the call at run time.

* It is associated with polymorphism and inheritance.

Message passing

*A message for an object is a request for execution of a procedure, and therefore will invoke
a function in the receiving object that generates the desired result.

*Message passing involves specifying the name of the object, the name of the function
(message) and the information to be sent.

FEATURES OF JAVA


*Java is a Object Oriented Programming Language (OOPL).

*It is not pure OOPL because it supports primitive data types like int,float,char etc.; these are
not objects.

*Primary objective of Java was to make it portable, simple and secure programming language.

* “code once use everywhere”.

* The features of Java are also known as Java buzzwords.

* Important features of the Java language are

I)Simple

*Java is very easy to learn, and its syntax is simple, clean and easy to understand.

II)Object-oriented

*Java is an object-oriented programming language. Everything in Java is an object.

Written for

Institution
Course

Document information

Uploaded on
February 28, 2024
Number of pages
21
Written in
2023/2024
Type
SUMMARY

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
perasraince

Get to know the seller

Seller avatar
perasraince GPTCMUTTOM
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
2
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