Question: Write a Class statement that defines a class named SongInfo. The class contains three Private String variables named _strName, _strArtist, and _strSongLength. Name the corresponding
Write a Class statement that defines a class named SongInfo. The class contains three Private String variables named _strName, _strArtist, and _strSongLength. Name the corresponding properties SongName, Artist, and SongLength. Then, use the syntax shown in Version 2 in Figure 11-5 to create a Song object, assigning it to a variable named hipHop.

Instantiating an Object from a Class Syntax Version 1 (Dim | Private) variableName As className variableName = New className Syntax Version 2 (Dim | Private) variableName As New className Example 1 (using Syntax Version 1) Private hoursInfo As TimeCard O = hoursInfo = New TimeCard The Private instruction creates a TimeCard variable named hoursInfo; the assignment statement instantiates a TimeCard object and assigns it to the hoursInfo variable. Example 2 (using Syntax Version 2) Dim hoursInfo As New TimeCard The Dim instruction creates a TimeCard variable named hoursInfo and also instantiates a TimeCard object, which it assigns to the hoursInfo variable.
Step by Step Solution
3.41 Rating (164 Votes )
There are 3 Steps involved in it
Public Class SongInfo Private strName As String PrivatestrArtist As String PrivatestrSongLength ... View full answer
Get step-by-step solutions from verified subject matter experts
