SlideShare a Scribd company logo
1 of 10
k.Sivapriya
II.MSc(IT)
Department of CS&IT
Nadar Saraswathi College of Arts and Science
Theni
Class Definition
 A class definition starts with the
keyword Class followed by the class name; and the
class body, ended by the End Class statement
 attributelist is a list of attributes that apply to the
class. Optional.
 accessmodifier defines the access levels of the
class, it has values as - Public, Protected, Friend,
Protected Friend and Private. Optional.
 Shadows indicate that the variable re-declares
and hides an identically named element, or set of
overloaded elements, in a base class. Optional.
Cont..
 MustInherit specifies that the class can be used
only as a base class and that you cannot create an
object directly from it, i.e., an abstract class.
Optional.
 NotInheritable specifies that the class cannot be
used as a base class.
 Partial indicates a partial definition of the class.
 Inherits specifies the base class it is inheriting
from.
 Implements specifies the interfaces the class is
inheriting from.
Member Functions and
Encapsulation
 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
Constructors and Destructors
 A class constructor is a special member Sub
of a class that is executed whenever we
create new objects of that class. A
constructor has the name New and it does
not have any return type.
 A default constructor does not have any
parameter, but if you need, a constructor
can have parameters. Such constructors are
called parameterized constructors.
Cont..
 A destructor is a special member Sub of a
class that is executed whenever an object of
its class goes out of scope.
 A destructor has the name Finalize and it
can neither return a value nor can it take
any parameters. Destructor can be very
useful for releasing resources before
coming out of the program like closing
files, releasing memories, etc.
Shared Members of a VB.Net
Class
 We can define class members as static using
the Shared keyword. When we declare a
member of a class as Shared, it means no
matter how many objects of the class are
created, there is only one copy of the member.
 The keyword Shared implies that only one
instance of the member exists for a class.
Shared variables are used for defining
constants because their values can be retrieved
by invoking the class without creating an
instance of it.
Inheritance
 One of the most important concepts in object-
oriented programming is that of inheritance.
Inheritance allows us to define a class in terms of
another class which makes it easier to create and
maintain an application. This also provides an
opportunity to reuse the code functionality and
fast implementation time.
 When creating a class, instead of writing
completely new data members and member
functions, the programmer can designate that the
new class should inherit the members of an
existing class. This existing class is called
the base class, and the new class is referred to as
the derived class.
Base & Derived Classes
 A class can be derived from more than one
class or interface, which means that it can
inherit data and functions from multiple
base classes or interfaces.
Base Class Initialization
 The derived class inherits the base class
member variables and member methods.
Therefore, the super class object should be
created before the subclass is created. The
super class or the base class is implicitly
known as MyBase in VB.Net

More Related Content

What's hot

What's hot (20)

Inheritance in java
Inheritance in java Inheritance in java
Inheritance in java
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in Java
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Inner classes in java
Inner classes in javaInner classes in java
Inner classes in java
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Classes, objects, methods, constructors, this keyword in java
Classes, objects, methods, constructors, this keyword  in javaClasses, objects, methods, constructors, this keyword  in java
Classes, objects, methods, constructors, this keyword in java
 
Java Inheritance | Java Course
Java Inheritance | Java Course Java Inheritance | Java Course
Java Inheritance | Java Course
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
java-06inheritance
java-06inheritancejava-06inheritance
java-06inheritance
 
Interfaces in java
Interfaces in javaInterfaces in java
Interfaces in java
 
Java inheritance
Java inheritanceJava inheritance
Java inheritance
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
 
JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++
 
Inheritance in oops
Inheritance in oopsInheritance in oops
Inheritance in oops
 
Unit 3 Java
Unit 3 JavaUnit 3 Java
Unit 3 Java
 
Java interface
Java interfaceJava interface
Java interface
 

Similar to Class properties

Learn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & InheritanceLearn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & InheritanceEng Teong Cheah
 
Classes-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfClasses-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfismartshanker1
 
Class-١.pptx vbdbbdndgngngndngnnfndfnngn
Class-١.pptx vbdbbdndgngngndngnnfndfnngnClass-١.pptx vbdbbdndgngngndngnnfndfnngn
Class-١.pptx vbdbbdndgngngndngnnfndfnngnYoussefSameh20
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Javabackdoor
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfArpitaJana28
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismJawad Khan
 
Class objects oopm
Class objects oopmClass objects oopm
Class objects oopmShweta Shah
 
Classes & objects new
Classes & objects newClasses & objects new
Classes & objects newlykado0dles
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsMaryo Manjaruni
 
Chapter18 class-and-objects
Chapter18 class-and-objectsChapter18 class-and-objects
Chapter18 class-and-objectsDeepak Singh
 
Understanding class, object & interface
Understanding class, object & interfaceUnderstanding class, object & interface
Understanding class, object & interfaceMD. Shohag Mia
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++Muhammad Waqas
 

Similar to Class properties (20)

Learn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & InheritanceLearn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & Inheritance
 
Classes-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfClasses-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdf
 
Class-١.pptx vbdbbdndgngngndngnnfndfnngn
Class-١.pptx vbdbbdndgngngndngnnfndfnngnClass-١.pptx vbdbbdndgngngndngnnfndfnngn
Class-١.pptx vbdbbdndgngngndngnnfndfnngn
 
4 Classes & Objects
4 Classes & Objects4 Classes & Objects
4 Classes & Objects
 
Oops
OopsOops
Oops
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphism
 
Class and object
Class and objectClass and object
Class and object
 
inheritance
inheritanceinheritance
inheritance
 
Class objects oopm
Class objects oopmClass objects oopm
Class objects oopm
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 
Classes & objects new
Classes & objects newClasses & objects new
Classes & objects new
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
 
Chapter18 class-and-objects
Chapter18 class-and-objectsChapter18 class-and-objects
Chapter18 class-and-objects
 
Understanding class, object & interface
Understanding class, object & interfaceUnderstanding class, object & interface
Understanding class, object & interface
 
Inheritance
InheritanceInheritance
Inheritance
 
C# interview
C# interviewC# interview
C# interview
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 

More from Siva Priya

source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquesSiva Priya
 
Planning the development process
Planning the development processPlanning the development process
Planning the development processSiva Priya
 
recovery management with concurrent controls
recovery management with concurrent controlsrecovery management with concurrent controls
recovery management with concurrent controlsSiva Priya
 
Web technology
Web technology Web technology
Web technology Siva Priya
 
Retail of big data analytics
Retail of big data analyticsRetail of big data analytics
Retail of big data analyticsSiva Priya
 
Deadlock and shadow paging
Deadlock and shadow pagingDeadlock and shadow paging
Deadlock and shadow pagingSiva Priya
 
density based method and expectation maximization
density based method and expectation maximizationdensity based method and expectation maximization
density based method and expectation maximizationSiva Priya
 
Classification by backpropacation
Classification by backpropacationClassification by backpropacation
Classification by backpropacationSiva Priya
 
Disk scheduling & Disk management
Disk scheduling & Disk managementDisk scheduling & Disk management
Disk scheduling & Disk managementSiva Priya
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithmSiva Priya
 
Servlets & jdbc
Servlets & jdbcServlets & jdbc
Servlets & jdbcSiva Priya
 

More from Siva Priya (12)

source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
 
Planning the development process
Planning the development processPlanning the development process
Planning the development process
 
recovery management with concurrent controls
recovery management with concurrent controlsrecovery management with concurrent controls
recovery management with concurrent controls
 
Web technology
Web technology Web technology
Web technology
 
Retail of big data analytics
Retail of big data analyticsRetail of big data analytics
Retail of big data analytics
 
Deadlock and shadow paging
Deadlock and shadow pagingDeadlock and shadow paging
Deadlock and shadow paging
 
Mobile IP
Mobile IPMobile IP
Mobile IP
 
density based method and expectation maximization
density based method and expectation maximizationdensity based method and expectation maximization
density based method and expectation maximization
 
Classification by backpropacation
Classification by backpropacationClassification by backpropacation
Classification by backpropacation
 
Disk scheduling & Disk management
Disk scheduling & Disk managementDisk scheduling & Disk management
Disk scheduling & Disk management
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Servlets & jdbc
Servlets & jdbcServlets & jdbc
Servlets & jdbc
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Class properties

  • 1. k.Sivapriya II.MSc(IT) Department of CS&IT Nadar Saraswathi College of Arts and Science Theni
  • 2. Class Definition  A class definition starts with the keyword Class followed by the class name; and the class body, ended by the End Class statement  attributelist is a list of attributes that apply to the class. Optional.  accessmodifier defines the access levels of the class, it has values as - Public, Protected, Friend, Protected Friend and Private. Optional.  Shadows indicate that the variable re-declares and hides an identically named element, or set of overloaded elements, in a base class. Optional.
  • 3. Cont..  MustInherit specifies that the class can be used only as a base class and that you cannot create an object directly from it, i.e., an abstract class. Optional.  NotInheritable specifies that the class cannot be used as a base class.  Partial indicates a partial definition of the class.  Inherits specifies the base class it is inheriting from.  Implements specifies the interfaces the class is inheriting from.
  • 4. Member Functions and Encapsulation  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
  • 5. Constructors and Destructors  A class constructor is a special member Sub of a class that is executed whenever we create new objects of that class. A constructor has the name New and it does not have any return type.  A default constructor does not have any parameter, but if you need, a constructor can have parameters. Such constructors are called parameterized constructors.
  • 6. Cont..  A destructor is a special member Sub of a class that is executed whenever an object of its class goes out of scope.  A destructor has the name Finalize and it can neither return a value nor can it take any parameters. Destructor can be very useful for releasing resources before coming out of the program like closing files, releasing memories, etc.
  • 7. Shared Members of a VB.Net Class  We can define class members as static using the Shared keyword. When we declare a member of a class as Shared, it means no matter how many objects of the class are created, there is only one copy of the member.  The keyword Shared implies that only one instance of the member exists for a class. Shared variables are used for defining constants because their values can be retrieved by invoking the class without creating an instance of it.
  • 8. Inheritance  One of the most important concepts in object- oriented programming is that of inheritance. Inheritance allows us to define a class in terms of another class which makes it easier to create and maintain an application. This also provides an opportunity to reuse the code functionality and fast implementation time.  When creating a class, instead of writing completely new data members and member functions, the programmer can designate that the new class should inherit the members of an existing class. This existing class is called the base class, and the new class is referred to as the derived class.
  • 9. Base & Derived Classes  A class can be derived from more than one class or interface, which means that it can inherit data and functions from multiple base classes or interfaces.
  • 10. Base Class Initialization  The derived class inherits the base class member variables and member methods. Therefore, the super class object should be created before the subclass is created. The super class or the base class is implicitly known as MyBase in VB.Net