chap04 - Chapter 4 VB.NET Programming with Supplied Classes...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Object-Oriented Application Development Using VB .NET 1 Chapter 4 VB .NET Programming with Supplied Classes
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 2 Objectives In this chapter, you will: Use the namespaces and classes supplied with VB .NET Use the String class Create a String array Use the ArrayList class
Background image of page 2
Object-Oriented Application Development Using VB .NET 3 Objectives In this chapter, you will: Work with dates Format numeric output Use the MessageBox class Display a Form
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 4 Using the Namespaces and Classes Supplied with VB .NET VB .NET is part of Microsoft’s Visual Studio .NET Visual Studio .NET is part of .NET technology Two important pieces of .NET framework: Common Language Runtime (CLR) .NET class library CLR supports common services used by Visual Studio .NET languages
Background image of page 4
Object-Oriented Application Development Using VB .NET 5 Using the Namespaces and Classes Supplied with VB .NET .NET class library: predefined classes and their methods, organized into namespaces Namespace: group of related classes Keyword Imports: gives compiler access to classes contained in specific namespaces
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 6 Using the String Class String: collection of characters VB .NET stores string data in instances of String class String class is a member of System namespace Code to declare a string: Dim s1 As String = "Hello Again"
Background image of page 6
Object-Oriented Application Development Using VB .NET 7 Using the String Class
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 8 Using the String Class String values in VB .NET are immutable – they cannot be changed Methods that appear to change a string value actually create and return a new String instance Index Each character in a String instance has an index Index values in VB .NET begin with zero
Background image of page 8
Object-Oriented Application Development Using VB .NET 9 Using String Methods Copy method returns a second String that is a copy of the String sent as an argument ' create a copy of s1 Dim s2 As String = String.Copy(s1) Console.WriteLine("s2, a copy of s1, contains " & s2)
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 10 Using String Methods Chars method returns the character at a specified index Console.WriteLine("char at index 6 of s1 is " & s1.Chars(6))
Background image of page 10
Object-Oriented Application Development Using VB .NET 11 Using String Methods There are two options to see whether two string values are equal Equal sign (=) If s1 = s2 Then Console.WriteLine("s1 = s2") Equals method Console.WriteLine("s1.Equals(s2) returns " & s1.Equals(s2))
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 12 Using String Methods SubString method: Extracts one or more characters from a String instance Returns a new String instance containing extracted characters s1.Substring(0, 5))
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/07/2008 for the course CSC 208 taught by Professor Walker during the Spring '06 term at Monroe CC.

Page1 / 41

chap04 - Chapter 4 VB.NET Programming with Supplied Classes...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online