SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Implementing Object Oriented Programming
In Visual Basic.NET

Pre-Assessment Questions
    •    Consider the following statements:
         • Statement A: There are two types of user interfaces, character user
             interface and (CUI) and graphical user interface (GUI).
         • Statement B: In CUI, you can interact with an application by entering
             commands.
         Which of the following is correct with respect to the above statements?
         d.  Both, Statement A and Statement B, are False.
         e.  Both, Statement A and Statement B, are True.
         f.  Statement A is True and Statement B is False.
         g.  Statement A is False and Statement B is True.




 ©NIIT                  Introduction to VB.NET            Lesson 2A / Slide 1 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Pre-Assessment Questions (Contd.)
    2. Which of the statements is false?
        •    A Windows Form is a representation of any window displayed in an
             application.
        •    Windows form properties are used to determine its appearance at
             compile time.
        •    Every Window Form is a class derived from Form class in
             System.Windows.Forms namespace.
        •    The form class is derived from the control class.




 ©NIIT                  Introduction to VB.NET            Lesson 2A / Slide 2 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Pre-Assessment Questions (Contd.)
    3.   Which of the following data types can contain values between 0 and 65535?
          •   Boolean
          •   String
          •   Char
          •   Decimal

    •    In the following code
                           Dim Result as Boolean
                           Result = X<Y
         •    The Result will have the true value
         •    The Result will have false value
         •    The Result will have either true or false value
         •    The Result will have no value



 ©NIIT                    Introduction to VB.NET                Lesson 2A / Slide 3 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Pre-Assessment Questions (Contd.)
    5. Data types like Boolean,String or Integer are
        •     Composite data types
        •     System data types
        •     Object data types
        •     Array data types




 ©NIIT                   Introduction to VB.NET        Lesson 2A / Slide 4 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Solutions to Pre-Assessment
  Questions
    •    b.
    •    b.
    •    c. Char
    •    a.
    •    b. System data type




 ©NIIT                  Introduction to VB.NET   Lesson 2A / Slide 5 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Objectives
    In this lesson, you will learn to:
         • Identify classes and objects
         • List the advantages of using classes and objects
         • Declare and import namespaces
         • Implement abstract classes in Visual Basic .NET
         • Declare structures and interfaces
         • Create and instantiate a class
         • Create an inherited form in Visual Basic .NET
         • Implement inheritance in VB .NET




 ©NIIT                   Introduction to VB.NET               Lesson 2A / Slide 6 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Understanding Object-Orientation
Concepts
    •    Visual Basic.Net is an object-oriented programming language.
    •    Visual Basic .NET supports all the four features of object-oriented
         programming.
    •    The features of object-oriented programming are
           • Encapsulation
           • Abstraction
           • Inheritance
           • Polymorphism.




 ©NIIT                      Introduction to VB.NET              Lesson 2A / Slide 7 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Understanding Classes
         •   A class is a conceptual representation of all the entities that share
             common attributes and behaviors.




 ©NIIT                     Introduction to VB.NET               Lesson 2A / Slide 8 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Object
    •    An object is an instance of a class
    •    All the objects of a class have individual copies of the attributes and share a
         common set of behaviors




 ©NIIT                      Introduction to VB.NET              Lesson 2A / Slide 9 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Advantages of Using Classes and
 Objects
    •    Maintenance of code by introducing modularity
    •    Encapsulation of internal complexities in code from end-users
    •    Reusabilty
    •    Support for a single interface to implement multiple methods




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 10 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

 Constructors
    •    Constructors are special methods that allow control over the initialization of
         objects.
    •    A shared constructor will not run more than once during a single execution of a
         program.
    •    When an instance of a class is created, the run-time environment executes the
         instance constructors.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 11 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Destructors
    •    Destructors are special methods that are used to release the instance of a
         class from memory.
    •    There are two types of destructors in Visual Basic .NET, Finalize() and
         Dispose().
    •    The sequences in which the constructors and destructors are invoked are:
           • Shared constructor of the inherited class
           • Shared constructor of the base class
           • Instance constructor of the base class
           • Instance constructor of the inherited class




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 12 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Namespaces
    •    Namespaces enable you to avoid name collisions.
    •    Every project in Visual Basic .NET has a root namespace, which is set in the
         Property page of the project Using Namespaces.
    •    You can also organize classes using the Namespace keyword as shown below.
                Namespace CustNameSpace
                Class CustClass
                End Class
                End Namespace
    •    You can use namespaces explicitly through direct addressing or implicitly
         through the Imports statement.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 13 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

 Abstract Classes in Visual Basic .NET
    •    Visual Basic .NET enables you to create abstract classes that contain the
         skeleton of the methods implemented by the derived class.




 ©NIIT                     Introduction to VB.NET             Lesson 2A / Slide 14 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Understanding Structures
    •     A structure is used to create user-defined data types.
    •     You can declare a structure when you want a single variable to hold multiple
         types of related data.
    •    Data can be stored in and retrieved from a structure.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 15 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Interfaces in Visual Basic.NET
    •    Interfaces are inheritable in Visual Basic.Net.
    •    An interface defines properties, methods, and events.
    •    You declare an interface using the Interface and End Interface statements.
    •    You can declare only methods, functions, properties, and events in an
         interface.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 16 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Interfaces in Visual Basic.NET(Contd.)
    •    An interface can inherit members from an existing interface
    •    The members of an interface consist of the declared members and the
         members inherited from its base interfaces.




 ©NIIT                    Introduction to VB.NET           Lesson 2A / Slide 17 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

 Inheritance
    •    The inheritance feature allows you to define a new class by extending an
         existing class.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 18 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Polymorphism
    •    The concept of using operators or functions in different ways depending on
         what they are operating on is called polymorphism.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 19 of 27
Implementing Object Oriented Programming
In Visual Basic.NET




                Demo for
   Creating a Class in Visual Basic.Net




 ©NIIT        Introduction to VB.NET   Lesson 2A / Slide 20 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Problem Statement
    •    A company called Protec Inc. needs to maintain customer information. The
         details of the customer need to be accepted through a graphical interface. The
         user interface can be either Windows Forms, Web Forms, or Console. The
         customer information also needs to be stored in relevant memory variables of
         a class. The information should also be retrieved and displayed to the user.
         The details of the customer will include CustomerID, First Name, Last
         Name, Address, Telephone number and E-mail Id.




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 21 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Solution
    •    A user interface screen is used to accept data from the user and displaying
         data to the user. A class can be used to store and retrieve data from the
         database. Perform the following steps to create a class:
           • Create a user interface.
           • Adding a class to the project
           • Write the code to store and retrieve data from the class
           •  Save and run the application




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 22 of 27
Implementing Object Oriented Programming
In Visual Basic.NET




                Demo for
         Implementing Inheritance




 ©NIIT        Introduction to VB.NET   Lesson 2A / Slide 23 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Problem Statement
    •    The company Protec Inc needs data entry forms to store information in the
         Customers, Orders, and Query Handling databases. The data entry forms
         should have a similar user interface with the Reset and Exit buttons.
         Incorporate the interface for the Order details form.




 ©NIIT                    Introduction to VB.NET          Lesson 2A / Slide 24 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Solution
    •    To create the user interface form you need to perform the following steps:
           • Create the user interface screen
           • Add code for the controls
           • Create an inherited form based on the base form
           • Add an inherited form to the project
           • Add the additional user interface control
           • Display a similar user interface
           • Add code for the inherited controls
           • Save and Execute the application




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 25 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Summary
    In this lesson, you learned that:
    • Visual Basic .NET is an object-oriented programming language
    • Classes can be added to a Visual Basic .NET project
    • An object is an instance of a class
    • Advantages of Using Classes and Objects
          • Maintenance of code
          • Encapsulation
          • Reusabilty
          • Support for a single interface to implement multiple methods
    • Constructors are special methods that allow control over the initialization of
        objects.
    • Destructors are special methods that are used to release the instance of a
        class from memory.



 ©NIIT                    Introduction to VB.NET            Lesson 2A / Slide 26 of 27
Implementing Object Oriented Programming
In Visual Basic.NET

Summary (Contd.)
    •    An important advantage of using a namespace is the prevention of a name
         collision
    •    Abstract classes are used to define the skeleton of the methods that the
         derived class can implement.
    •    A structure is used to create user-defined data types.
    •    An interface enables you to separate the definition of objects from their
         implementation so that the objects can evolve without the risk of introducing
         incompatibility in existing applications.
    •    The inheritance feature allows you to define a new class by extending an
         existing class
    •    The concept of using operators or functions in different ways depending on
         what they are operating on is called polymorphism.
    •    Interfaces and classes are inheritable in Visual Basic .NET




 ©NIIT                     Introduction to VB.NET            Lesson 2A / Slide 27 of 27

Weitere ähnliche Inhalte

Andere mochten auch

Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual BasicSangeetha Sg
 
Modelos de desarrollo de aplicaciones web
Modelos de desarrollo de aplicaciones webModelos de desarrollo de aplicaciones web
Modelos de desarrollo de aplicaciones webYaskelly Yedra
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Isuru Perera
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.netGirija Muscut
 
Vb.net session 15
Vb.net session 15Vb.net session 15
Vb.net session 15Niit Care
 
Transforming the world with Information technology
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technologyGlenn Klith Andersen
 
What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++Microsoft
 
Part 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valuePart 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valueGirija Muscut
 
Part 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netGirija Muscut
 
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uPython Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uNikola Plejic
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be SeenMark Pesce
 
Part 1 picturebox using vb.net
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.netGirija Muscut
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3a_akhavan
 
Cognitive information science
Cognitive information scienceCognitive information science
Cognitive information scienceS. Kate Devitt
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.netGirija Muscut
 

Andere mochten auch (19)

Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
Modelos de desarrollo de aplicaciones web
Modelos de desarrollo de aplicaciones webModelos de desarrollo de aplicaciones web
Modelos de desarrollo de aplicaciones web
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.net
 
Presentation1
Presentation1Presentation1
Presentation1
 
Vb.net session 15
Vb.net session 15Vb.net session 15
Vb.net session 15
 
Transforming the world with Information technology
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technology
 
What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++
 
Part 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valuePart 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative value
 
Part 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.net
 
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uPython Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be Seen
 
Part 1 picturebox using vb.net
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.net
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Information Overload and Information Science / Mieczysław Muraszkiewicz
Information Overload and Information Science / Mieczysław MuraszkiewiczInformation Overload and Information Science / Mieczysław Muraszkiewicz
Information Overload and Information Science / Mieczysław Muraszkiewicz
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
 
Cognitive information science
Cognitive information scienceCognitive information science
Cognitive information science
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.net
 

Ähnlich wie Vb.net session 03

Vb net xp_03
Vb net xp_03Vb net xp_03
Vb net xp_03Niit Care
 
Vb.net session 04
Vb.net session 04Vb.net session 04
Vb.net session 04Niit Care
 
Vb.net session 09
Vb.net session 09Vb.net session 09
Vb.net session 09Niit Care
 
Vb.net session 13
Vb.net session 13Vb.net session 13
Vb.net session 13Niit Care
 
10265 developing data access solutions with microsoft visual studio 2010
10265 developing data access solutions with microsoft visual studio 201010265 developing data access solutions with microsoft visual studio 2010
10265 developing data access solutions with microsoft visual studio 2010bestip
 
Vb.net session 02
Vb.net session 02Vb.net session 02
Vb.net session 02Niit Care
 
Csc253 chapter 09
Csc253 chapter 09Csc253 chapter 09
Csc253 chapter 09PCC
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netJaya Kumari
 
Vb net xp_01
Vb net xp_01Vb net xp_01
Vb net xp_01Niit Care
 
Vb.net session 10
Vb.net session 10Vb.net session 10
Vb.net session 10Niit Care
 
04 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_0504 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_05Niit Care
 
Asp.NETZERO - A Workshop Presentation by Citytech Software
Asp.NETZERO - A Workshop Presentation by Citytech SoftwareAsp.NETZERO - A Workshop Presentation by Citytech Software
Asp.NETZERO - A Workshop Presentation by Citytech SoftwareRitwik Das
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application veera
 

Ähnlich wie Vb.net session 03 (20)

Vb net xp_03
Vb net xp_03Vb net xp_03
Vb net xp_03
 
Vb.net session 04
Vb.net session 04Vb.net session 04
Vb.net session 04
 
Vb.net session 09
Vb.net session 09Vb.net session 09
Vb.net session 09
 
Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Vb.net session 13
Vb.net session 13Vb.net session 13
Vb.net session 13
 
10265 developing data access solutions with microsoft visual studio 2010
10265 developing data access solutions with microsoft visual studio 201010265 developing data access solutions with microsoft visual studio 2010
10265 developing data access solutions with microsoft visual studio 2010
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Vb.net session 02
Vb.net session 02Vb.net session 02
Vb.net session 02
 
Grade 9 COMPUTER
Grade 9 COMPUTERGrade 9 COMPUTER
Grade 9 COMPUTER
 
Csc253 chapter 09
Csc253 chapter 09Csc253 chapter 09
Csc253 chapter 09
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Vb net xp_01
Vb net xp_01Vb net xp_01
Vb net xp_01
 
Dacj 1-1 c
Dacj 1-1 cDacj 1-1 c
Dacj 1-1 c
 
Vb.net session 10
Vb.net session 10Vb.net session 10
Vb.net session 10
 
04 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_0504 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_05
 
Asp.NETZERO - A Workshop Presentation by Citytech Software
Asp.NETZERO - A Workshop Presentation by Citytech SoftwareAsp.NETZERO - A Workshop Presentation by Citytech Software
Asp.NETZERO - A Workshop Presentation by Citytech Software
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application
 
About .net
About .net About .net
About .net
 

Mehr von Niit Care (20)

Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
Dacj 1-1 b
Dacj 1-1 bDacj 1-1 b
Dacj 1-1 b
 
Dacj 1-1 a
Dacj 1-1 aDacj 1-1 a
Dacj 1-1 a
 

Kürzlich hochgeladen

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Kürzlich hochgeladen (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Vb.net session 03

  • 1. Implementing Object Oriented Programming In Visual Basic.NET Pre-Assessment Questions • Consider the following statements: • Statement A: There are two types of user interfaces, character user interface and (CUI) and graphical user interface (GUI). • Statement B: In CUI, you can interact with an application by entering commands. Which of the following is correct with respect to the above statements? d. Both, Statement A and Statement B, are False. e. Both, Statement A and Statement B, are True. f. Statement A is True and Statement B is False. g. Statement A is False and Statement B is True. ©NIIT Introduction to VB.NET Lesson 2A / Slide 1 of 27
  • 2. Implementing Object Oriented Programming In Visual Basic.NET Pre-Assessment Questions (Contd.) 2. Which of the statements is false? • A Windows Form is a representation of any window displayed in an application. • Windows form properties are used to determine its appearance at compile time. • Every Window Form is a class derived from Form class in System.Windows.Forms namespace. • The form class is derived from the control class. ©NIIT Introduction to VB.NET Lesson 2A / Slide 2 of 27
  • 3. Implementing Object Oriented Programming In Visual Basic.NET Pre-Assessment Questions (Contd.) 3. Which of the following data types can contain values between 0 and 65535? • Boolean • String • Char • Decimal • In the following code Dim Result as Boolean Result = X<Y • The Result will have the true value • The Result will have false value • The Result will have either true or false value • The Result will have no value ©NIIT Introduction to VB.NET Lesson 2A / Slide 3 of 27
  • 4. Implementing Object Oriented Programming In Visual Basic.NET Pre-Assessment Questions (Contd.) 5. Data types like Boolean,String or Integer are • Composite data types • System data types • Object data types • Array data types ©NIIT Introduction to VB.NET Lesson 2A / Slide 4 of 27
  • 5. Implementing Object Oriented Programming In Visual Basic.NET Solutions to Pre-Assessment Questions • b. • b. • c. Char • a. • b. System data type ©NIIT Introduction to VB.NET Lesson 2A / Slide 5 of 27
  • 6. Implementing Object Oriented Programming In Visual Basic.NET Objectives In this lesson, you will learn to: • Identify classes and objects • List the advantages of using classes and objects • Declare and import namespaces • Implement abstract classes in Visual Basic .NET • Declare structures and interfaces • Create and instantiate a class • Create an inherited form in Visual Basic .NET • Implement inheritance in VB .NET ©NIIT Introduction to VB.NET Lesson 2A / Slide 6 of 27
  • 7. Implementing Object Oriented Programming In Visual Basic.NET Understanding Object-Orientation Concepts • Visual Basic.Net is an object-oriented programming language. • Visual Basic .NET supports all the four features of object-oriented programming. • The features of object-oriented programming are • Encapsulation • Abstraction • Inheritance • Polymorphism. ©NIIT Introduction to VB.NET Lesson 2A / Slide 7 of 27
  • 8. Implementing Object Oriented Programming In Visual Basic.NET Understanding Classes • A class is a conceptual representation of all the entities that share common attributes and behaviors. ©NIIT Introduction to VB.NET Lesson 2A / Slide 8 of 27
  • 9. Implementing Object Oriented Programming In Visual Basic.NET Object • An object is an instance of a class • All the objects of a class have individual copies of the attributes and share a common set of behaviors ©NIIT Introduction to VB.NET Lesson 2A / Slide 9 of 27
  • 10. Implementing Object Oriented Programming In Visual Basic.NET Advantages of Using Classes and Objects • Maintenance of code by introducing modularity • Encapsulation of internal complexities in code from end-users • Reusabilty • Support for a single interface to implement multiple methods ©NIIT Introduction to VB.NET Lesson 2A / Slide 10 of 27
  • 11. Implementing Object Oriented Programming In Visual Basic.NET Constructors • Constructors are special methods that allow control over the initialization of objects. • A shared constructor will not run more than once during a single execution of a program. • When an instance of a class is created, the run-time environment executes the instance constructors. ©NIIT Introduction to VB.NET Lesson 2A / Slide 11 of 27
  • 12. Implementing Object Oriented Programming In Visual Basic.NET Destructors • Destructors are special methods that are used to release the instance of a class from memory. • There are two types of destructors in Visual Basic .NET, Finalize() and Dispose(). • The sequences in which the constructors and destructors are invoked are: • Shared constructor of the inherited class • Shared constructor of the base class • Instance constructor of the base class • Instance constructor of the inherited class ©NIIT Introduction to VB.NET Lesson 2A / Slide 12 of 27
  • 13. Implementing Object Oriented Programming In Visual Basic.NET Namespaces • Namespaces enable you to avoid name collisions. • Every project in Visual Basic .NET has a root namespace, which is set in the Property page of the project Using Namespaces. • You can also organize classes using the Namespace keyword as shown below. Namespace CustNameSpace Class CustClass End Class End Namespace • You can use namespaces explicitly through direct addressing or implicitly through the Imports statement. ©NIIT Introduction to VB.NET Lesson 2A / Slide 13 of 27
  • 14. Implementing Object Oriented Programming In Visual Basic.NET Abstract Classes in Visual Basic .NET • Visual Basic .NET enables you to create abstract classes that contain the skeleton of the methods implemented by the derived class. ©NIIT Introduction to VB.NET Lesson 2A / Slide 14 of 27
  • 15. Implementing Object Oriented Programming In Visual Basic.NET Understanding Structures • A structure is used to create user-defined data types. • You can declare a structure when you want a single variable to hold multiple types of related data. • Data can be stored in and retrieved from a structure. ©NIIT Introduction to VB.NET Lesson 2A / Slide 15 of 27
  • 16. Implementing Object Oriented Programming In Visual Basic.NET Interfaces in Visual Basic.NET • Interfaces are inheritable in Visual Basic.Net. • An interface defines properties, methods, and events. • You declare an interface using the Interface and End Interface statements. • You can declare only methods, functions, properties, and events in an interface. ©NIIT Introduction to VB.NET Lesson 2A / Slide 16 of 27
  • 17. Implementing Object Oriented Programming In Visual Basic.NET Interfaces in Visual Basic.NET(Contd.) • An interface can inherit members from an existing interface • The members of an interface consist of the declared members and the members inherited from its base interfaces. ©NIIT Introduction to VB.NET Lesson 2A / Slide 17 of 27
  • 18. Implementing Object Oriented Programming In Visual Basic.NET Inheritance • The inheritance feature allows you to define a new class by extending an existing class. ©NIIT Introduction to VB.NET Lesson 2A / Slide 18 of 27
  • 19. Implementing Object Oriented Programming In Visual Basic.NET Polymorphism • The concept of using operators or functions in different ways depending on what they are operating on is called polymorphism. ©NIIT Introduction to VB.NET Lesson 2A / Slide 19 of 27
  • 20. Implementing Object Oriented Programming In Visual Basic.NET Demo for Creating a Class in Visual Basic.Net ©NIIT Introduction to VB.NET Lesson 2A / Slide 20 of 27
  • 21. Implementing Object Oriented Programming In Visual Basic.NET Problem Statement • A company called Protec Inc. needs to maintain customer information. The details of the customer need to be accepted through a graphical interface. The user interface can be either Windows Forms, Web Forms, or Console. The customer information also needs to be stored in relevant memory variables of a class. The information should also be retrieved and displayed to the user. The details of the customer will include CustomerID, First Name, Last Name, Address, Telephone number and E-mail Id. ©NIIT Introduction to VB.NET Lesson 2A / Slide 21 of 27
  • 22. Implementing Object Oriented Programming In Visual Basic.NET Solution • A user interface screen is used to accept data from the user and displaying data to the user. A class can be used to store and retrieve data from the database. Perform the following steps to create a class: • Create a user interface. • Adding a class to the project • Write the code to store and retrieve data from the class •  Save and run the application ©NIIT Introduction to VB.NET Lesson 2A / Slide 22 of 27
  • 23. Implementing Object Oriented Programming In Visual Basic.NET Demo for Implementing Inheritance ©NIIT Introduction to VB.NET Lesson 2A / Slide 23 of 27
  • 24. Implementing Object Oriented Programming In Visual Basic.NET Problem Statement • The company Protec Inc needs data entry forms to store information in the Customers, Orders, and Query Handling databases. The data entry forms should have a similar user interface with the Reset and Exit buttons. Incorporate the interface for the Order details form. ©NIIT Introduction to VB.NET Lesson 2A / Slide 24 of 27
  • 25. Implementing Object Oriented Programming In Visual Basic.NET Solution • To create the user interface form you need to perform the following steps: • Create the user interface screen • Add code for the controls • Create an inherited form based on the base form • Add an inherited form to the project • Add the additional user interface control • Display a similar user interface • Add code for the inherited controls • Save and Execute the application ©NIIT Introduction to VB.NET Lesson 2A / Slide 25 of 27
  • 26. Implementing Object Oriented Programming In Visual Basic.NET Summary In this lesson, you learned that: • Visual Basic .NET is an object-oriented programming language • Classes can be added to a Visual Basic .NET project • An object is an instance of a class • Advantages of Using Classes and Objects • Maintenance of code • Encapsulation • Reusabilty • Support for a single interface to implement multiple methods • Constructors are special methods that allow control over the initialization of objects. • Destructors are special methods that are used to release the instance of a class from memory. ©NIIT Introduction to VB.NET Lesson 2A / Slide 26 of 27
  • 27. Implementing Object Oriented Programming In Visual Basic.NET Summary (Contd.) • An important advantage of using a namespace is the prevention of a name collision • Abstract classes are used to define the skeleton of the methods that the derived class can implement. • A structure is used to create user-defined data types. • An interface enables you to separate the definition of objects from their implementation so that the objects can evolve without the risk of introducing incompatibility in existing applications. • The inheritance feature allows you to define a new class by extending an existing class • The concept of using operators or functions in different ways depending on what they are operating on is called polymorphism. • Interfaces and classes are inheritable in Visual Basic .NET ©NIIT Introduction to VB.NET Lesson 2A / Slide 27 of 27