-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: s_hashim
Message 1 in Discussion


The user-defined type (UDT) 
supported by previous versions of Visual Basic is generalized to a structure in 
Visual Basic .NET. A structure is a concatenation of one or more members of 
various data types. The structure is treated as a single unit, although its 
members can also be accessed individually.
 
A structure declaration starts with 
the Structure statement and ends with the End Structure statement. The Structure 
statement supplies the name of the structure, which is also the identifier of 
the data type being defined by the structure. Other parts of the code can use 
this identifier to declare the data type of variables, arguments, and function 
return values.
 
The following paradigm shows the 
declaration of a structure.
 
[Public | Protected | Friend | 
Protected Friend | Private] Structure structname
   {Dim | Public | 
Friend | Private} member1 As datatype1
   ...
   {Dim 
| Public | Friend | Private} memberN As datatypeN
End Structure
The 
declarations between the Structure and End Structure statements define the 
members of the structure. Every member must be declared using a Dim statement or 
a statement that specifies access, such as Public, Private, or Friend. If a Dim 
statement is used, the access defaults to public.
 

A reference type that 
encapsulates data (constants and fields) and behavior (methods, properties, 
indexers, events, operators, instance constructors, static constructors, and 
destructors), and can contain nested types. Class types support inheritance, a 
mechanism whereby a derived class can extend and specialize a base class. See 
also: encapsulation, indexer, property, reference type.
 

********** 
Keep Smiling, 
Regards. 

Sayad Hashim Ali Kazi 

Microsoft India 
Community Star. 
*********************** 
SQL Star International Ltd. 
SQL House, #13,Infocity,Madhapur, 
Hyderabad 500 081. 
Tel: +91-40-2310 1650(Off) +91-40-55683272(Resi) 

http://www.mugh.net 
http://SayadHashim.blogspot.com 
http://dotnetjunkies.com/WebLog/SayadHashim/ 
*********************************** 

  -----Original Message-----
From: dotnet_ramu 
  [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 2:59 
  PM
To: BDOTNET
Subject: What is the difference between the 
  structure and class and Exact Usage of Struct


  
    
      
      New Message on BDOTNET
    
      

  What is 
    the difference between the structure and class and Exact Usage of 
    Struct


    
      
      
        Reply

        
          
            
            
               
              Reply to Sender   Recommend 
              Message 1 in 
                Discussion 
      
        
          
            
            
              From: dotnet_ramu 
            
              

                What is the difference between the structure and class and 
                where exactly the Structre is used. 
                 
                I saw a code which is normally will be in a class but the 
                following Methods and Property were there in a Structure
                 
                Public Interface IAccount
                    Sub MakeDeposit(ByVal Amount As 
                Decimal)
                    ReadOnly Property Balance() As 
                Decimal
                End Interface
                 
                Public Structure AccountInfo
    
                Implements IAccount
                 
                    Public m_Balance As Decimal
                 
                    Public Sub MakeDeposit(ByVal Amount As 
                Decimal) Implements 
                IAccount.MakeDeposit
        
                m_Balance += Amount
    End Sub
                 
                    Public ReadOnly Property Balance() As 
                Decimal Implements 
                IAccount.Balance
        
                Get
            
                Return m_Balance
        
                End Get
    End Property
                 
                End Structure
                 
                I know that Implementation of the Interface IAccount is 
                done in the Structure, but the question is where exactly this 
                structure is used? and why they have not Implemented in a 
                Class?
                 
View other groups in this 
    category. 



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to