Java Tutorial: OOP with Java( Lab 02)

preview_player
Показать описание
Java with oop tutorial
java oop tutorial
They are an abstraction, encapsulation, inheritance, and polymorphism. Grasping them is key to understanding how Java works. Basically, Java OOP concepts let us create working methods and variables, then re-use all or part of them without compromising security.
Рекомендации по теме
Комментарии
Автор

BSCS Section B
FA18_BCS_076
Ans-3
> The variables declared inside the class are known as data members.
> Data members may be private or public, but are usually held private so that values may only be changed at the discretion of the class function members.
> A data member may be of any type, including classes already defined, pointers to objects of any type, or even references to objects of any type.

coderbyte
Автор

Shumaila Zahid
FA18-BCS-087
Class?

A class, in the context of Java, are templates that are used to create objects, and to define object data types and methods

shumyyla_
Автор

BSCS Section B
FA18_BCS_076
Ans-2
> The functions declared inside the class are known as member functions.
> Member functions are methods or functions that are defined inside of objects.
> Generally used to manipulate data members and other object data.

coderbyte
Автор

BSCS Section B
FA18-BCS-093
Tajammal Amin
Member Functions:
Member functions are the functions that have their declaration inside the class and they operate on the data members of class. They may have their definitions inside or outside of class

tajammalamin
Автор

Object:
?


The Object is the real-time entity having some state and behavior. An object stores its state in fields and exposes its behavior through methods (functions in some programming languages).
Member Function:
?


Data member also known as property and member function as behavior in the object oriented programming language terms


Data member .
?


Data member also known as property and member function as behavior in the object oriented programming language terms. Each cat object can then store, maintain and provide upon request its own information regarding its color and age.


C++ /


Both Java and
C++ support object oriented programming, yet there are differences between them. To begin with, Java is a pure object oriented programming language; therefore, everything is an object in Java (single root hierarchy as everything gets derived from java,
Java ….public
C++ privat

rishetoor
Автор

BSCS Section B FA18_BCS_093
Tajammal Amin
Data Member:
Data member is variable for object that defines the behavior of a class. it's also legit to say that data members are kinda attributes or properties of a class

tajammalamin
Автор

BCS-B17-075. Section B
Object:
It is a piece of code which represent the real life entity. Object has Noun, property, method.
Member Functions:
They are functions that defined inside of objects.
Data Members:
The variables declared inside the class are known as data members. They may be private or public.

qamarzaman
Автор

BSCS Section B Reg no. 106



1: Everything that have attributes and well defined behavior
is called object.

eg. A car, A pen, Time, Name etc.





2: The function or method or behaviors that exactly perform
the work in the program.




3: Attributes of the class or properties of the class is
also called data member.




4: C++ Class:




 (i)Cannot get by default class


 (ii)Main function is separate and class in separate

 (iii)By default, Private behavior provide.




Java class:




(i) This is made by default class


 (ii) Main function is not separate from class.


 (iii) By default, Public behavior provide.

usgames
Автор

CIIT/FA18-BCS-058/VHR
Muhammad Javed
Q.1--(Ans):
A object is a part of class. object is also known as instance of a particular class.

muhammadjaved
Автор

CIIT/FA18-BCS-058/VHR
Muhammad Javed

Q.2--(Ans):
A member function is a function of a class that has its own definition or prototype within the class definition.

muhammadjaved
Автор

CIIT/FA18-BCS-058/VHR
Muhammad Javed

Q.3--(Ans):
A data member may be of any type, including classes already defined.Data members may be private or public, but are usually held private.

muhammadjaved
Автор

CIIT/FA18-BCS-058/VHR
Muhammad Javed

Q.4--(Ans):
java is pure object oriented language but c++ is a both procedural and object oriented programming language. In C++, class are private or public but in java the default class is public.

muhammadjaved
Автор

BSCS Section B
FA18_BCS_076
Ans-1
> In object-oriented programming (OOP), objects are the things you think about first in designing a program and they are also the units of code that are eventually derived from the process.
>Each object is an instance of a particular class or subclass with the class's own methods or procedures and data variables.

coderbyte
Автор

BSCS Section B
FA18_BCS_076
Ans-4
C++:
>A Class is a user defined data-type which has data members and member functions.
>Data members are the data variables and member functions are the functions used to manipulate these variables and together these data members and member functions defines the properties and behaviour of the objects in a Class
>In C++, when you declare a variable whose type is a class, storage is allocated for an object of that class, and the class's constructor function is called to initialise that instance of the class.

JAVA:
>In Java, you are really declaring a pointer to a class object; no storage is allocated for the class object, and no constructor function is called until you use "new".
>In Java, every variable, constant, and function (including main) must be inside some class.

coderbyte
Автор

Muhammad Awais Mukhtar
BCS(B17)-050 Section-A
Q)3: What is Data Members?
Ans: An object may contain values which are stored internally and are unique to that object.
In order to do this, each value needs an appropriate declaration as a data member in the class.
A data member may be of any type, including classes already defined, pointers to objects of any type, or even references to objects of any type.
Data members may be private or public, but are usually held private so that values may only be changed at the discretion of the class function members.
In the example below, the class C contains two a private data member of type int, and a public data member of type pointer to char.
class C {
private:
int x;
public:
float f;
};

MuhammadAwais-fgfs
Автор

Muhammad Awais Mukhtar
BCS(B17)-050 Section-A


Q)1: What is object in OOP?
Ans: Definition:
An object is a software bundle of variables and related methods.
As the name object-oriented implies, objects are key to understanding object-oriented technology.
You can look around you now and see many examples of real-world objects:
your dog, your desk, your television set, your bicycle.

MuhammadAwais-fgfs
Автор

BSCS Section B
FA18-BCS-093
Tajammal Amin
Object:
Any thing that has properly defined attributes(state and behavior)
For Example:
Car is an object, because it has a color, model, number(states) and engine power, engine ignition time, braking power etc(behavior)

tajammalamin
Автор

Muhammad Awais Mukhtar
BCS(B17)-050 Section-A
Q)2: What is Member Function?
Ans: A member function of a class is a function that has its definition or its prototype within the class definition like any other variable.
It operates on any object of the class of which it is a member, and has access to all the members of a class for that object.
Example:
class Box {
public:
double length; // Length of a box
double breadth; // Breadth of a box
double height; // Height of a box
double getVolume(void);// Returns box volume
};

MuhammadAwais-fgfs
Автор

HURAIZA HASSAN Reg#FA18-BCS-037
Q#03: What is Data Member?
An object may contain values which are stored internally and are unique to that object. In order to do this, each value needs an appropriate declaration as a data member in the class. A data member may be of any type, including classes already defined, pointers to objects of any type, or even references to objects of any type.

huraizahassan
Автор

HURAIZA HASSAN Reg#FA18-BCS-037
Q#01: What is Object?
In object-oriented programming (OOP), objects are the things you think about first in designing a program and they are also the units of code that are eventually derived from the process.

huraizahassan
join shbcf.ru