-
vb.net面试_VB.Net面试问答
vb.net面试
Here are 45+ frequently asked VB.Net interview questions and answers which will definitely help you out to crack one of the toughest interviews.
这里有45多个VB.Net面试常见问题和答案,这些绝对可以帮助您破解最艰难的面试之一。
1. What is .NET Framework?
1.什么是.NET Framework?
It is a platform independent and language independent developed by Microsoft. It allows you to use multiple programming languages such as VB.NET , C#, VBScript, Jscript, and managed C++ Codes on multiple platforms such as LINUX, Mac OS, Windows, UNIX. It provides the user with various libraries that helps the development of applications faster, cheaper and easier.
它是由Microsoft开发的独立于平台和语言的平台。 它允许您在LINUX,Mac OS,Windows,UNIX等多个平台上使用多种编程语言,例如VB.NET,C#,VBScript,Jscript和托管C ++代码。 它为用户提供了各种库,这些库有助于更快,更便宜和更容易地开发应用程序。
2. What is CTS?
2.什么是CTS?
CTS represents Common Type System. It is a subset of Common Language Specification. In order to keep consistency, Microsoft has specified a Common Tpe System to which every language must follow so as to keep equality and relativity within multiple languages within the same .NET program.
CTS表示通用类型系统。 它是公共语言规范的子集。 为了保持一致性,Microsoft已经指定了每种语言都必须遵循的Common Tpe System,以便在同一.NET程序中的多种语言之间保持相等性和相对性。
3. What is a Constructor in VB.NET?
3. VB.NET中的构造函数是什么?
A Constructor is a special member function or a method whose task is to initialize objects of its class. Its name is the same as its class name. It is called as constructor because it constructs the values of data members of the class. The constructor is invoked whenever an object of its associated class is created.
构造函数是一个特殊的成员函数或方法,其任务是初始化其类的对象。 它的名称与它的类名相同。 之所以称为构造函数,是因为它构造了类的数据成员的值。 每当创建其关联类的对象时,就会调用构造函数。
4. Explain Public Access Modifier in VB.NET.
4.在VB.NET中解释公共访问修饰符。
The Public keyword in the declaration statement specifies that the element can be accessed from code anywhere in the same project from other projects that reference the project and from any assembly built from the project.
声明语句中的Public关键字指定可以从同一项目中引用该项目的其他项目以及从该项目构建的任何程序集中的任意位置的代码访问元素。
Example:
例:
Public Class demoPublicClass
公共类demoPublicClass
However, a Public Class can be used only at module, interface or namespace level.
但是,公共类只能在模块,接口或名称空间级别使用。
5. Enlist Controls in Windows Forms to Select Data from a list of VB.NET.
5.在Windows窗体中注册控件以从VB.NET列表中选择数据。
The Windows Forms Controls to Select Data from a List are as follows: 1. CheckedListBox 2. ComboBox 3. DomainUpDown 4. List Box 5. List View
从列表中选择数据的Windows窗体控件如下: 1. CheckedListBox 2. ComboBox 3. DomainUpDown 4. List Box 5. List视图
6. What is the Default Size of Integer DataType in VB.NET?
6. VB.NET中Integer数据类型的默认大小是多少?
The Default Size of Integer DataType is 32 Bits in VB.NET.
在VB.NET中,整数数据类型的默认大小为32位。
7. Example of Hello World Program in VB.NET.
7. VB.NET中的Hello World程序示例。
Module HelloWorld Sub Main() Console.WriteLine(“Hello World”) End Sub End Module
模块HelloWorld Sub Main() Console.WriteLine(“ Hello World”) End Sub End模块
8. What is CLS?
8.什么是CLS?
CLS represents Common Language Specification. It is basically a subset of the entire set of features supported by the CLR.
CLS表示通用语言规范。 它基本上是CLR支持的全部功能的子集。
9. What is Object Oriented Programming Approach?
9.什么是面向对象的编程方法?
Object Oriented Programming provides a way of modularizing programs by creating partitioned memory area for functions as well as data that can be used as templates for creating copies of such modules on demand. OOP allows decomposition of a problem into a numerous entities called Objects. It then builds data and functions around these objects.
面向对象编程通过创建用于功能的分区存储区以及可用作按需创建此类模块副本的模板的数据,提供了一种使程序模块化的方法。 OOP允许将问题分解成许多个称为Objects的实体。 然后,它围绕这些对象构建数据和功能。
10. What is Garbage Collection?
10.什么是垃圾回收?
Garbage Collection is primarily used for Memory Management. The .NET Framework’s Garbage Collection manages the allocation and release of the memory to your applications. The garbage collector checks for objects in the managed heap that are no longer being used by the applications when it performs garbage collection.
垃圾回收主要用于内存管理。 .NET Framework的垃圾收集管理对应用程序的内存分配和释放。 垃圾收集器检查托管堆中执行垃圾收集时应用程序不再使用的对象。
11. Explain Protected Friend Access Modifier in VB.NET.
11.在VB.NET中解释受保护的朋友访问修饰符。
The Protected and Friend keywords together in the declaration statement specify that the elements within the same assembly or both.
声明语句中的Protected和Friend关键字一起指定同一程序集中的元素或两者。
Example:
例:
Protected Friend demoString As String
受保护的朋友demoString作为字符串
It can be used only at class level but not at level of Source File or Namespace or inside an Interface, Module, Structure or Procedure.
它只能在类级别使用,而不能在源文件或命名空间级别使用,也不能在接口,模块,结构或过程内部使用。
12. What are Shared Assemblies?
12.什么是共享程序集?
When private assembly is installed in Global Assembly Cache, it is called as Shared Assembly. It does not create any physical copy and when the Assembly is installed in GAC, it can be referred to any .NET application.
在全球程序集缓存中安装专用程序集时,它称为共享程序集。 它不会创建任何物理副本,并且在GAC中安装了Assembly时,可以将其引用到任何.NET应用程序。
13. Enlist some features of C# not present in VB.NET.
13.征集VB.NET中不存在的C#的某些功能。
Some of the features which are not present in VB but present in C# are as follows they are: 1. C# supports unsafe code blocks for improved performance. 2. C# also supports Multi Line comments and static classes 3. Anonymous methods and Partial interfaces
VB中不存在但C#中存在的一些功能如下: 1. C#支持不安全的代码块,以提高性能。 2. C#还支持多行注释和静态类 。3.匿名方法和部分接口
14. What is a Framework?
14.什么是框架?
A Framework is a layered structure that indicates the type of programs that can or should be built and how they would inter-relate.Some fameworks also includes actual programs, specify computer programming interfaces, and also offer programming tools for using the frameworks. It is basically a conceptual structure or a scheme with an intension to support the development of something that expands the structure into something useful.
框架是分层的结构,指示可以或应该构建的程序类型以及它们之间的相互关系。一些fameworks还包括实际程序,指定计算机编程接口,并提供使用框架的编程工具。 它基本上是一种概念结构或旨在支持某种事物发展的方案,该事物将结构扩展为有用的事物。
15. What is an Object?
15.什么是对象?
Objects are basic Run-Time entities in an Object oriented system. They may represent a place, a bank account or a person. Objects are essentially the variables that are of Class types.
对象是面向对象系统中的基本运行时实体。 他们可能代表一个地点,一个银行帐户或一个人。 对象本质上是属于类类型的变量。
16. What is MSIL?
16.什么是MSIL?
MSIL represents Microsoft Intermediate Language. It is similar to the Java Byte Code. Its main motive is to form a platform independent code. Before executing a code, MSIL must be converted to a CPU-specific code by Just in Time Compiler.
MSIL代表Microsoft中间语言。 它类似于Java字节码。 其主要动机是形成独立于平台的代码。 在执行代码之前,必须通过即时编译器将MSIL转换为特定于CPU的代码。
17. What are Datasets?
17.什么是数据集?
Datasets are objects that contain data tables where you can temporarily store the data for use in application. If your application requires working with data, you can load data into a dataset. You can also execute or modify data in the dataset even when its offline.
数据集是包含数据表的对象,您可以在其中临时存储数据以供应用程序使用。 如果您的应用程序需要使用数据,则可以将数据加载到数据集中。 您也可以在数据集中离线执行或修改数据。
18. What is Assembly Manifest?
18.什么是组装清单?
Every Assembly contains an Assembly Manifest. It consists of the following: 1. The Assembly’s Identity (Name and Version) 2. File Table describing all other files that make up the assembly. 3. Assembly Reference List that contains information about External Dependencies. 4. Global Objects
每个程序集都包含一个程序集清单。 它包含以下内容: 1.程序集的标识(名称和版本) 2.文件表,描述组成程序集的所有其他文件。 3.程序集引用列表,其中包含有关外部依赖项的信息。 4.全局对象
19. Explain .NET compilation process.
19.解释.NET编译过程。
1. Compilation of source code to managed code / Intermediate Language (IL). 2. Compilation of IL to platform-specific code by the CLR. 3. MSIL defines a set of portable instructions which are independent of any specific CPU.
1.将源代码编译为托管代码/中间语言(IL)。 2. CLR将IL编译为特定于平台的代码。 3. MSIL定义了一组可移植指令,这些指令独立于任何特定的CPU。
20. Enlist the Garbage Collection Methods in .NET Framework.
20.在.NET Framework中注册垃圾收集方法。
The .NET Framework garbage collection methods are as follows: 1. Dispose 2. Finalize
.NET Framework的垃圾回收方法如下: 1.处理 2.完成
21. What is a Message Box in VB.NET?
21. VB.NET中的消息框是什么?
A message box is a dialog box that displays application-related information to the user. Message boxes are also used to request information from the user.
消息框是一个对话框,向用户显示与应用程序相关的信息。 消息框还用于向用户请求信息。
22. What is a Class?
22.什么是班级?
An entire set of data and code of an object can be made user-defined data type using a class. Objects are variables of Class type. After defining a Class, we can create numerous Objects of its type. A Class is a collection of Objects of similar type.
可以使用类将对象的整个数据和代码集设置为用户定义的数据类型。 对象是Class类型的变量。 定义一个类后,我们可以创建许多类型的对象。 类是相似类型的对象的集合。
23. Explain Assembly Types.
23.解释装配类型。
All Assemblies and type libraries must be registered in the Windows registry as COM Clients and they can use the managed types. Assembly are primarily of the following types: 1. Shared Assemblies 2. Private Assemblies
所有程序集和类型库必须在Windows注册表中注册为COM客户端,并且它们可以使用托管类型。 装配主要有以下几种: 1.共享装配 2.私人装配
24. What is New Keyword used for? A New keyword is used to declare or initialize a New Object. It is used to set a variable with reference to a datatype. The New keyword is used to initialize an object variable. Example:
24.新关键字的用途是什么? New关键字用于声明或初始化New Object。 用于参考数据类型设置变量。 New关键字用于初始化对象变量。 例:
dim object1 as New SqlDataAdapter.
将object1调暗为New SqlDataAdapter。
25. What is CLR?
25.什么是CLR?
CLR represents Common Language Runtime. It is one of the most important component of the .NET Framework. It manages and executes the code written in .NET architecture and similar to Java Virtual Machine. The software version of .NET is actually a CLR version.
CLR表示公共语言运行时。 它是.NET Framework最重要的组件之一。 它管理和执行以.NET体系结构编写的代码,并且类似于Java虚拟机。 .NET的软件版本实际上是CLR版本。
26. What are Assemblies?
26.什么是装配体?
Assemblies are the building blocks of .NET Framework applications. It creates a fundamental unit of deployment, version control, reusage, activation scoping and security permissions. It is a combination of Types and Resources built to work together and form a logical unit of functionality.
程序集是.NET Framework应用程序的构建块。 它创建了部署,版本控制,重用,激活范围和安全权限的基本单元。 它是类型和资源的组合,旨在共同协作并形成功能的逻辑单元。
27. How do you define a Class in VB.NET?
27.如何在VB.NET中定义类?
Example:
例:
Class Demo Public Name as String End Class
类演示 公共名称作为字符串 结束类
28. Enlist Types of Data Validations.
28.征用数据验证的类型。
1. Code Checking 2. Data Type Validation 3. Complex Validation 4. Range Checking
1.代码检查 2.数据类型验证 3.复杂验证 4.范围检查
29. What are Private Assemblies?
29.什么是私人大会?
Assemblies are Private by default. When you use it in any of the .NET applications, a physical copy of it gets created. The program will generate an error when you try to change the Output File Location. To overcome this issue, we use Shared Assembly in Global Assembly Cache.
默认情况下,程序集是私有的。 在任何.NET应用程序中使用它时,都会创建它的物理副本。 当您尝试更改输出文件位置时,程序将生成错误。 为了解决此问题,我们在全局程序集缓存中使用共享程序集。
30. What is the difference between Functions and Sub-Routines?
30. Function和Sub-Routines有什么区别?
Functions in VB.NET can send information back to where it had been called from. Also known as Function Return method compared to C++ or Java. The only difference with Sub-Routines is that they cannot Return Values.
VB.NET中的函数可以将信息发送回调用它的位置。 与C ++或Java相比,也称为Function Return方法。 子例程的唯一区别是它们不能返回值。
31. What is Global Assembly Cache?
31.什么是全局程序集缓存?
Every computer where the common language runtime executes has a machine-wide code cache called as Global Cache. It stores assemblies specifically required to be shared by multiple applications on the computer.
执行公共语言运行时的每台计算机都有一个机器范围的代码缓存,称为全局缓存。 它存储特别需要由计算机上的多个应用程序共享的程序集。
32. Explain Private Access Modifier in VB.NET.
32.在VB.NET中解释专用访问修饰符。
The Public keyword in the declaration statement indicates that the elements can be worked/manipulated only from within the same module, class or structure.
声明语句中的Public关键字指示只能在同一模块,类或结构中操作/操作元素。
Example:
例:
Private Number Integer
私人数字整数
Private can be used only at module level. This means you can declare a private element inside a module, class or structure but not at a level of a source file or namespace, inside an interface or in a procedure.
专用只能在模块级别使用。 这意味着您可以在模块,类或结构内声明私有元素,但不能在源文件或命名空间级别,接口内部或过程中声明私有元素。
33. Enlist the Dialog Boxes used in Windows Forms of VB.NET.
33.列出Windows VB.NET窗体中使用的对话框。
The Windows Forms Dialog Boxes are as follows: 1. ColorDialog 2. FontDialog 3. OpenFileDialog 4. PrintDialog 5. PrintPreviewDialog 6. SaveFileDialog
Windows窗体对话框如下: 1. ColorDialog 2. FontDialog 3. OpenFileDialog 4. PrintDialog 5. PrintPreviewDialog 6. SaveFileDialog
34. Enlist features which are common to all .NET languages?
34.使用所有.NET语言共有的功能吗?
Garbage Collection is a feature that is common to all .NET languages. Garbage Collection feature stops / pauses the application for a few seconds before restarting it. The .NET Framework’s Garbage Collection manages the allocation and release of the memory to your applications.
垃圾回收是所有.NET语言共有的功能。 垃圾收集功能会在重新启动应用程序之前将其停止/暂停几秒钟。 .NET Framework的垃圾收集管理对应用程序的内存分配和释放。
35. What is Redim variable in VB.NET used for?
35. VB.NET中的Redim变量是用来做什么的?
In VB.NET, Redim is used to re-declare and manipulate or modify the Array. Once we declare an Array with a dimension of 10 and if later we need to redefine the size, ReDim functionality can be used.
在VB.NET中,Redim用于重新声明和操纵或修改Array。 一旦声明了尺寸为10的Array,并且如果以后需要重新定义大小,则可以使用ReDim功能。
36. What is Polymorphism?
36.什么是多态?
It is the ablility to showcase or exhibit different behaviours under different instances. The process of making and Operator or a Function respond differently in different instances is known as Operator Overloading.
能够展示或展示在不同情况下的不同行为。 制作和操作员或功能在不同情况下做出不同响应的过程称为操作员重载。
37. What are MDI Forms in VB.NET?
37. VB.NET中的MDI表单是什么?
MDI represents Multiple Document Interface. It is an application in which we can view and work with several documents at once. Example of an MDI application is Microsoft Excel. Visual Studio .NET provides great support for working with MDI Forms and Applications.
MDI表示多文档接口。 在此应用程序中,我们可以一次查看和处理多个文档。 MDI应用程序的示例是Microsoft Excel。 Visual Studio .NET为使用MDI表单和应用程序提供了强大的支持。
38. Enlist the various Mouse Events in VB.NET.
38.在VB.NET中注册各种鼠标事件。
The list of Mouse Events in VB.NET are as follows: 1. Click 2. MouseClick 3. MouseDown 4. MouseWheel 5. MouseHover
VB.NET中的鼠标事件列表如下: 1.单击 2. MouseClick 3. MouseDown 4. MouseWheel 5. MouseHover
39. What are Destructors in VB.NET?
39. VB.NET中的析构函数是什么?
A Destructor is used to release or delete the objects that have been created by Constructor. In VB.NET, the Garbage Collector automatically manages the allocation , assignment and release of memory for the managed objects in your application. However, you may require Destructors to delete unmanaged resources that your application creates. There can be only one destructor for a class.
析构函数用于释放或删除由构造函数创建的对象。 在VB.NET中,垃圾收集器自动管理应用程序中托管对象的内存分配,分配和释放。 但是,您可能需要Destructor删除应用程序创建的非托管资源。 一个类只能有一个析构函数。
40. Explain Inheritance in VB.NET
40.在VB.NET中解释继承
Inheritance is an Object Oriented Programming concept. It enables you to create a New Class that is reusable and can extend or modify the behaviour that is defined in another class. All Classes in Visual Basic by default inherits from the Object class that supports .NET class hierarchy and provides low-level services to all classes.
继承是一种面向对象的编程概念。 它使您能够创建可重用的新类,并且可以扩展或修改另一个类中定义的行为。 默认情况下,Visual Basic中的所有类都继承自Object类,该对象类支持.NET类层次结构,并为所有类提供低层服务。
41. Explain Protected Access Modifier in VB.NET.
41.在VB.NET中解释受保护的访问修饰符。
The Protected keyword in declaration statement mentions the elements that can be accessed only from within the same class, or from a class described from this class.
声明语句中的Protected关键字提到只能从同一类或从该类描述的类中访问的元素。
Example: Protected Class demoClass
示例: 受保护的类demoClass
You can use Protected modifier only at Class Level, but not at level of Source File or Namespace, or inside an Interface, Module Structure or Procedure.
您只能在类级别使用保护的修饰符,而不能在源文件或命名空间的级别或接口,模块结构或过程内部使用保护的修饰符。
42. Enlist Languages that .NET Framework Supports. 1. VB.NET 2. Managed C++ Codes 3. C# 4. VBScript 5. JScript
42.征用.NET Framework支持的语言。 1. VB.NET 2.托管C ++代码 3. C# 4. VBScript 5. JScript
43. What are Interfaces in VB.NET.
43.什么是VB.NET中的接口。
Interfaces define the properties, events and methods that classes can implement. Interfaces allow you to define features as small groups of closly related properties, methods, and events. With Interfaces, you can define features as small groups of closely related members.
接口定义了类可以实现的属性,事件和方法。 界面允许您将要素定义为紧密相关的属性,方法和事件的一小组。 使用接口,可以将要素定义为紧密相关的成员的小组。
44. What are Data Adapters in ADO.NET?
44.什么是ADO.NET中的数据适配器?
ADO.NET uses a data adapter as a bridge vetween the dataset and the datasource which is the actual database. Data Adapter provides the Fill() methods to retrieve data from the database and populate dataset. ADO.NET uses a data adapter object to mediate between the dataset object and the database.
ADO.NET使用数据适配器作为数据集和作为实际数据库的数据源之间的桥梁。 数据适配器提供Fill()方法以从数据库检索数据并填充数据集。 ADO.NET使用数据适配器对象在数据集对象和数据库之间进行中介。
45. Enlist the Differences between VB and VB.NET.
45.找出VB和VB.NET之间的差异。
1. VB.NET is an Interpreted Language whereas VB.NET is a Compiled one.
1. VB.NET是一种解释性语言,而VB.NET是一种编译语言。
2. Visual Basic is a Backword compatible whereas VB.NET is not backward compatible.
2. Visual Basic是Backword兼容的,而VB.NET不是向后兼容的。
3. VB cannot be used to develop Multi-Threaded applications whereas VB.NET helps to develop Multi-Threaded applications.
3. VB不能用于开发多线程应用程序,而VB.NET可以帮助开发多线程应用程序。
46. What is JIT in VB.NET?
46. VB.NET中的JIT是什么?
JIT represents Just in Time. It is basically a Compiler. It is a facility that is invoked by the CLR to convert the Intermediate Language into Machine Level Code. When the Assembly is loaded the method calls are invoked for compilation into native code. The .NET framework assembly files such as dll and exe cannot be executed by the target processor unless it is converted into native code.
JIT代表及时。 它基本上是一个编译器。 它是CLR调用的一种工具,用于将中间语言转换为机器级代码。 加载Assembly时,将调用方法调用以编译成本机代码。 除非将其转换为本机代码,否则目标处理器无法执行.NET框架程序集文件(例如dll和exe)。
47. Explain Friend Access Modifier in VB.NET.
47.在VB.NET中解释朋友访问修饰符。
The Friend keyword in the declaration statement specifies that the elements can be manipulated from within the same assemby but not from outside the assembly.
声明语句中的Friend关键字指定可以从同一装配内部操纵这些元素,但不能从程序集外部操纵这些元素。
Example:
例:
Friend demo As String
朋友演示As String
Friend modifier can be used only at Module, Interface in Namespace level.
Friend修饰符只能在命名空间级别的“模块”,“接口”上使用。
48. Enlist Tools for VB.NET Development.
48.征集VB.NET开发工具。
The tools for VB.NET development are as follows: 1. Mono Development Platform (Linux) 2. Microsoft Visual Studio
用于VB.NET开发的工具如下: 1. Mono开发平台(Linux) 2. Microsoft Visual Studio
So this was the list of some important VB.Net interview questions and answers. If you found any information incorrect or missing in above list then please mention it by commenting below.
因此,这是一些重要的VB.Net面试问答的列表。 如果您在上面的列表中发现任何不正确或缺失的信息,请在下面的评论中提及。
翻译自: https://www.thecrazyprogrammer.com/2015/11/vb-net-interview-questions-and-answers.html