Challenger App

No.1 PSC Learning App

1M+ Downloads

Which of the following statement is/are NOT correct about the access modifier in Visual Basic .NET?


(i) Protected access modifier applies to class members only.

(ii) Public access modifier defines a type that is accessible only from within its own class or from a derived class.

A(i) and (ii) only

B(i) only

C(ii) only

DNone

Answer:

C. (ii) only

Read Explanation:

Access modifiers in Visual Basic .NET are keywords that specify how a programming element can be accessed or how it will behave in a program. Some examples of access modifiers in Visual Basic .NET include : 

  • Public
    This modifier specifies that a programming element can be accessed from anywhere in the same project, from other projects that reference the project, and from any assembly built from the project. 
  • Protected
    This modifier specifies that a programming element can only be accessed from within the same class, or from a class derived from that class. 
  • Private
    This modifier specifies that a programming element is limited to the containing type. 


The default access modifiers for type members in Visual Basic are: 

  • Fields and constants: Private 
  • Methods: Public 
  • Structures: Public



Related Questions:

Which of the following cannot be part of an E-mail address?
The term _____ refers to a bad or criminal hacker.
The founder of Wiki Leaks is :
Which access method is used for obtaining a record from a cassette tape ?
Which feature of OOP indicates code reusability?