- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Lesson 2: Using Common Reference Types in Visual Basic .NET
Lesson 2: Using Common Reference Types QR Code Maker In Visual Basic .NET Using Barcode generation for VS .NET Control to generate, create QR Code image in .NET applications. www.OnBarcode.comQR Reader In Visual Basic .NET Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications. www.OnBarcode.comfinally { tr.Close(); } } catch (System.IO.FileNotFoundException ex) { MessageBox.Show("Sorry, the file does not exist."); } catch (System.UnauthorizedAccessException ex) { MessageBox.Show("Sorry, you lack sufficient privileges."); } catch (Exception ex) { MessageBox.Show(ex.Message); } Make Bar Code In VB.NET Using Barcode drawer for .NET Control to generate, create barcode image in Visual Studio .NET applications. www.OnBarcode.comDecoding Barcode In VB.NET Using Barcode scanner for .NET Control to read, scan read, scan image in .NET framework applications. www.OnBarcode.com5. Run your application again and verify that it displays your new error message when you provide an invalid filename. QR Code Drawer In Visual C#.NET Using Barcode creation for .NET Control to generate, create QR Code ISO/IEC18004 image in VS .NET applications. www.OnBarcode.comPainting QR Code In .NET Using Barcode generation for ASP.NET Control to generate, create QR Code 2d barcode image in ASP.NET applications. www.OnBarcode.comLesson Summary
QR Code Maker In VS .NET Using Barcode encoder for VS .NET Control to generate, create QR Code ISO/IEC18004 image in Visual Studio .NET applications. www.OnBarcode.com2D Barcode Maker In Visual Basic .NET Using Barcode printer for VS .NET Control to generate, create 2D Barcode image in VS .NET applications. www.OnBarcode.comReference types directly contain the address of data rather than the actual data. When you assign an instance of a value type, a second copy of the value is created. When you assign an instance of a reference type, only the pointer is copied. Therefore, if you assign an instance of a reference type and then modify the data, the data referenced by both the original variable and the second variable are changed. The .NET Framework includes a large number of built-in reference types that you can use directly or use to build your own custom types. Strings are immutable; use the StringBuilder class to create a dynamic string. Use streams to read from and write to files, memory, and the network. Use the catch clause within try blocks to filter exceptions by type. Close and dispose of nonmemory resources in the finally clause of a try block. Code128 Generation In VB.NET Using Barcode maker for .NET framework Control to generate, create Code 128 Code Set A image in .NET framework applications. www.OnBarcode.comGTIN - 13 Printer In Visual Basic .NET Using Barcode encoder for VS .NET Control to generate, create European Article Number 13 image in VS .NET applications. www.OnBarcode.comLesson Review
Bar Code Maker In VB.NET Using Barcode creator for Visual Studio .NET Control to generate, create barcode image in VS .NET applications. www.OnBarcode.comIndustrial 2 Of 5 Encoder In Visual Basic .NET Using Barcode encoder for .NET Control to generate, create Standard 2 of 5 image in VS .NET applications. www.OnBarcode.comYou can use the following questions to test your knowledge of the information in Lesson 2, Using Common Reference Types. The questions are also available on the companion CD if you prefer to review them in electronic form. Code 39 Creation In Objective-C Using Barcode drawer for iPhone Control to generate, create Code 3 of 9 image in iPhone applications. www.OnBarcode.comEAN-13 Supplement 5 Generator In None Using Barcode printer for Software Control to generate, create UPC - 13 image in Software applications. www.OnBarcode.comNOTE
Paint Code 39 In Java Using Barcode creator for Android Control to generate, create Code 3 of 9 image in Android applications. www.OnBarcode.comEncode ANSI/AIM Code 39 In None Using Barcode drawer for Excel Control to generate, create Code39 image in Excel applications. www.OnBarcode.comAnswers
Bar Code Creation In None Using Barcode maker for Font Control to generate, create bar code image in Font applications. www.OnBarcode.comPrinting Barcode In .NET Using Barcode creation for ASP.NET Control to generate, create bar code image in ASP.NET applications. www.OnBarcode.comAnswers to these questions and explanations of why each answer choice is right or wrong are located in the Answers section at the end of the book. Data Matrix 2d Barcode Generation In Visual C# Using Barcode encoder for VS .NET Control to generate, create DataMatrix image in .NET applications. www.OnBarcode.comRecognize DataMatrix In Java Using Barcode scanner for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.com 1
Framework Fundamentals
1. Which of the following are reference types (Choose all that apply.) A. Types declared Nullable B. String C. Exception D. All types derived from System.Object 2. What is the correct order for catch clauses when handling different exception types A. Most general to most specific B. Most likely to occur to least likely to occur C. Most specific to most general D. Least likely to occur to most likely to occur 3. Of the following scenarios, which would be a good reason to use the StringBuilder class instead of the String class A. When building a string from shorter strings B. When working with text data longer than 256 bytes C. When you want to search and replace the contents of a string D. When a string is a value type 4. Why should you close and dispose of resources in a finally block instead of a catch block A. It keeps you from having to repeat the operation in each catch. B. A finally block runs whether or not an exception occurs. C. The compiler throws an error if resources are not disposed of in the finally block. D. You cannot dispose of resources in a catch block. 5. You create an application with built-in exception handling. For some types of exceptions, you want to add an event to the Event Log that specifies the line of code that initiated the exception. Which Exception property should you use A. Message B. StackTrace C. Source D. Data Lesson 2: Using Common Reference Types
6. You pass a value-type variable into a procedure as an argument. The procedure changes the variable; however, when the procedure returns, the variable has not changed. What happened (Choose one.) A. The variable was not initialized before it was passed in. B. Passing a value type into a procedure creates a copy of the data. C. The variable was redeclared within the procedure level. D. The procedure handled the variable as a reference. 1
Framework Fundamentals
Lesson 3: Constructing Classes
In object-oriented languages, the bulk of the work should be performed within objects. All but the simplest applications require constructing one or more custom classes, each with multiple properties and methods used to perform tasks related to that object. This lesson discusses how to create custom classes. After this lesson, you will be able to: Describe and use inheritance Describe and use interfaces Describe and use partial classes Create a generic type and use the built-in generic types Respond to and raise events Add attributes to describe assemblies and methods Move a type from one class library to another using type forwarding Estimated lesson time: 40 minutes
|
|