Quiz
.NET(51-100)
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (50)
1Which of the following methods is the best to use to draw an empty triangle?
- AGraphics.DrawLines
- BGraphics.DrawRectangle
- CGraphics.DrawPolygon
- DGraphics.DrawEllipse
- EGraphics.FillRectangle
- FGraphics.FillPolygon
- GGraphics.FillEllipse
2Which of the following classes is required to draw an empty circle? (Choose 2)
- ASystem.Drawing.Graphics
- BSystem.Drawing.Pen
- CSystem.Drawing.Brush
- DSystem.Drawing.Bitma
3Which of the following brush classes is the best to use to create a solid rectangle that is red at the top and gradually fades to white towards the bottom?
- ASystem.Drawing.Drawing2D.HatchBrush
- BSystem.Drawing.Drawing2D.LinearGradientBrush
- CSystem.Drawing.Drawing2D.PathGradientBrush
- DSystem.Drawing.SolidBrush
- ESystem.Drawing.TextureBrush
4What type of line would the following code sample draw? // C#Graphics g = this.CreateGraphics(); Pen p = new Pen(Color.Red, 10); p.StartCap = LineCap.Flat; p.EndCap = LineCap.ArrowAnchor; g.DrawLine(p, 50, 50, 400, 50);
- AAn arrow pointing up
- BAn arrow pointing down
- CAn arrow pointing left
- DAn arrow pointing right
5
Which of the following classes could you use to display a JPEG image from an existing file in a form? (Choose 2)- ASystem.Drawing.Image
- BSystem.Drawing.Bitmap
- CSystem.Drawing.Imaging.Metafile
- DSystem.Windows.Forms.PictureBox
6How can you draw a black border around a JPEG image that you have saved to disk and then save the updated image back to the disk?
- ACreate a Graphics object by loading the JPEG image from the disk. Draw the border by calling Graphics.DrawRectangle. Finally, save the updated image by calling Graphics.Save.
- BCreate a Bitmap object by loading the JPEG image from the disk. Draw the border by calling Bitmap.DrawRectangle. Finally, save the updated image by calling Bitmap.Save.
- CCreate a Bitmap object by loading the JPEG image from the disk. Create a Graphics object by calling Graphics.FromImage. Draw the border by calling Graphics.DrawRectangle. Finally, save the updated image by calling Bitmap .Save.
- DCreate a Bitmap object by loading the JPEG image from the disk. Create a Graphics object by calling Bitmap.CreateGraphics. Draw the border by calling Graphics.DrawRectangle. Finally, save the updated image by calling Bitmap .Save.
7Which format is the best choice to use if you want to save a photograph that could be opened by a wide variety of applications?
- AImageFormat.Bmp
- BImageFormat.Gif
- CImageFormat.Jpeg
- DImageFormat.Png
8Which format is the best choice to use if you want to save a pie chart that could be opened by a wide variety of applications?
- AImageFormat.Bmp
- BImageFormat.Gif
- CImageFormat.Jpeg
- DImageFormat.Png
9What are the steps for adding text to an image?
- ACreate a Graphics object and a string object. Then call string.Draw.
- BCreate a Graphics object, a Font object, and a Brush object. Then call Graphics.DrawString.
- CCreate a Graphics object, a Font object, and a Pen object. Then call Graphics.DrawString.
- DCreate a Bitmap object, a Font object, and a Brush object. Then call Bitmap.DrawString.
10Which class would you need to create an instance of to specify that a string should be centered when drawn?
- AStringFormat
- BStringAlignment
- CFormatFlags
- DLineAlignment
11Which of the following commands would cause a string to be flush left?
- AStringFormat.LineAlignment = Near
- BStringFormat.LineAlignment = Far
- CStringFormat.Alignment = Near
- DStringFormat.Alignment = Far
12You are developing an application that will add text to JPEG, PNG, and GIF image files. Which class should you use to allow you to edit any of those image formats?
- AMetafile
- BIcon
- CBitmap
- DImage
13Which of the following statements are TRUE about the .NET CLR? (Choose 4)
- AIt provides a language-neutral development & execution environment.
- BIt ensures that an application would not be able to access memory that it is not authorized to access.
- CIt provides services to run "managed" applications.
- DThe resources are garbage collected.
- EIt provides services to run "unmanaged" applications.
14Which of the following are valid .NET CLR JIT performance counters? (Choose 2)
- ATotal memory used for JIT compilation
- BAverage memory used for JIT compilation
- CNumber of methods that failed to compile with the standard JIT
- DPercentage of processor time spent performing JIT compilation
- EPercentage of memory currently dedicated for JIT compilation
15Which of the following statements is correct about Managed Code?
- AManaged code is the code that is compiled by the JIT compilers.
- BManaged code is the code where resources are Garbage Collected.
- CManaged code is the code that runs on top of Windows.
- DManaged code is the code that is written to target the services of the CLR.
- EManaged code is the code that can run on top of Linux.
16Which of the following are NOT true about .NET Framework? (Choose 2)
- AIt provides a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
- BIt provides a code-execution environment that minimizes software deployment and versioning conflicts.
- CIt provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.
- DIt provides different programming models for Windows-based applications and Web-based applications.
- EIt provides an event driven programming model for building Windows Device Drivers.
17Which of the following components of the .NET framework provide an extensible set of classes that can be used by any .NET compliant programming language?
- A.NET class libraries
- BCommon Language Runtime
- CCommon Language Infrastructure
- DComponent Object Model
- ECommon Type System
18Which of the following jobs are NOT performed by Garbage Collector? (Choose 3)
- AFreeing memory on the stack.
- BAvoiding memory leaks.
- CFreeing memory occupied by unreferenced objects.
- DClosing unclosed database collections.
- EClosing unclosed files.
19Which of the following .NET components can be used to remove unused references from the managed heap?
- ACommon Language Infrastructure
- BCLR
- CGarbage Collector
- DClass Loader
- ECTS
20Which of the following statements correctly define .NET Framework?
- AIt is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web Services.
- BIt is an environment for developing, building, deploying and executing only Web Applications.
- CIt is an environment for developing, building, deploying and executing Distributed Applications.
- DIt is an environment for developing, building, deploying and executing Web Services.
- EIt is an environment for development and execution of Windows applications.
21Which of the following assemblies can be stored in Global Assembly Cache?
- APrivate Assemblies
- BFriend Assemblies
- CShared Assemblies
- DPublic Assemblies
- EProtected Assemblies
22Which of the following constitutes the .NET Framework? (Choose 2)
- AASP.NET Applications
- BCLR
- CFramework Class Library
- DWinForm Applications
- EWindows Services
23Code that targets the Common Language Runtime is known as
- AUnmanaged
- BDistributed
- CLegacy
- DManaged Code
- ENative Code
24Which of the following statements is correct about the .NET Framework?
- A.NET Framework uses DCOM for achieving language interoperability.
- B.NET Framework is built on the DCOM technology.
- C.NET Framework uses DCOM for making transition between managed and unmanaged code.
- D.NET Framework uses DCOM for creating unmanaged applications.
- E.NET Framework uses COM+ services while creating Distributed Applications.
25Which of the following is the root of the .NET type hierarchy?
- ASystem.Object
- BSystem.Type
- CSystem.Base
- DSystem.Parent
- ESystem.Root
26Which of the following benefits do we get on running managed code under CLR? (Choose 4)
(АППЕЛЯЦИОННЫЙ ВОПРОС!)- AType safety of the code running under CLR is assured.
- BIt is ensured that an application would not access the memory that it is not authorized to access.
- CIt launches separate process for every application running under it.
- DThe resources are Garbage collected.
27Which of the following statements are correct about JIT? (Choose 3)
- AJIT compiler compiles instructions into machine code at run time.
- BThe code compiler by the JIT compiler runs under CLR.
- CThe instructions compiled by JIT compilers are written in native code.
- DThe instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
- EThe method is JIT compiled even if it is not called
28Which of the following are parts of the .NET Framework? (Choose 2)
- AThe Common Language Runtime (CLR)
- BThe Framework Class Libraries (FCL)
- CMicrosoft Published Web Services
- DApplications deployed on IIS
- EMobile Applications
29Which one of the following classes are present System.Collections.Genericnamespace? (Choose 2)
- AStack
- BTree
- CSortedDictionary
- DSortedArray
30For the code snippet shown below, which of the following statements are valid? public class Generic<T>{ public T Field; public void TestSub() { T i = Field + 1; } } class MyProgram { static void Main(string[] args) { Generic<int> gen = new Generic<int>(); gen.TestSub(); } }
- AAddition will produce result 1.
- BResult of addition is system-dependent.
- CProgram will generate run-time exception.
- DCompiler will report an error: Operator '+' is not defined for types T and int.
- ENone of the above.
31Which of the following statements are valid about generics in .NET Framework? (Choose 2)
- AGenerics is a language feature.
- BWe can create a generic class, however, we cannot create a generic interface in C#.NET.
- CGenerics delegates are not allowed in C#.NET.
- DGenerics are useful in collection classes in .NET framework.
- ENone of All
32Which of the following statements is valid about generic procedures in C#.NET?
- AAll procedures in a Generic class are generic.
- BOnly those procedures labeled as Generic are generic.
- CGeneric procedures can take at the most one generic parameter.
- DGeneric procedures must take at least one type parameter.
- ENone of All.
33For the code snippet given below, which of the following statements is valid? public class Generic<T> { public T Field;} class Program { static void Main(string[ ] args) { Generic<String> g = new Generic<String>(); g.Field = "Hello"; Console.WriteLine(g.Field); }}
- AIt will print string "Hello" on the console.
- BName Generic cannot be used as a class name because it's a keyword.
- CCompiler will give an error.
- DMember Field of class Generic is not accessible directly.
- ENone of the above.
34For the code snippet given below, which of the following statements are valid? public class MyContainer<T> where T: IComparabte { // Insert code here } (Choose 2)
- AClass MyContainer requires that it's type argument must implementIComparabte interface.
- BType argument of class MyContainer must be IComparabte.
- CCompiler will report an error for this block of code.
- DThis requirement on type argument is called as constraint
35For the code snippet given below, which of the following statements are valid? public class MyContainer<T> where T: class, IComparable { //Insert code here} (Choose 2)
- AClass MyContainer requires that it's type argument must implementIComparable interface.
- BCompiler will report an error for this block of code.
- CThere are multiple constraints on type argument to MyContainer class.
- DClass MyContainer requires that its type argument must be a reference type and it must implement IComparable interface.
36Which of the following statements is valid about advantages of generics?
- AGenerics shift the burden of type safety to the programmer rather than compiler.
- BGenerics require use of explicit type casting.
- CGenerics provide type safety without the overhead of multiple implementations.
- DGenerics eliminate the possibility of run-time errors.
- ENone of the above.
37Which of the following statements is correct about the C#.NET code snippet given below? interface IMyInterface { void fun1(); int fun2(); } class MyClass: IMyInterface { void fun1() { } int IMyInterface.fun2() { } }
- AA function cannot be declared inside an interface.
- BA subroutine cannot be declared inside an interface.
- CA Method Table will not be created for class MyClass.
- DMyClass is an abstract class.
- EThe definition of fun1() in class MyClass should be void IMyInterface.fun1().
38Which of the following can be declared in an interface? (Choose 3)
- AProperties
- BMethods
- CEnumerations
- DEvents
- EStructures
39Which of the following statements is correct about an interface used in C#.NET?
- AOne class can implement only one interface.
- BIn a program if one class implements an interface then no other class in the same program can implement this interface.
- CFrom two base interfaces a new interface cannot be inherited.
- DProperties can be declared inside an interface.
- EInterfaces cannot be inherited.
40Which of the following statements is correct about Interfaces used in C#.NET?
- AAll interfaces are derived from an Object class.
- BInterfaces can be inherited.
- CAll interfaces are derived from an Object interface.
- DInterfaces can contain only method declaration.
- EInterfaces can contain static data and methods.
41Which of the following statements is correct about an interface used in C#.NET?
- AIf a class implements an interface partially, then it should be an abstract class.
- BA class cannot implement an interface partially.
- CAn interface can contain static methods.
- DAn interface can contain static data.
- EMultiple interface inheritance is not allowed.
42Which of the following statements is correct about an interface?
- AOne interface can be implemented in another interface.
- BAn interface can be implemented by multiple classes in the same program.
- CA class that implements an interface can explicitly implement members of that interface.
- DThe functions declared in an interface have a body.
43Which of the following statements are correct about an interface in C#.NET? (Choose 3)
- AA class can implement multiple interfaces.
- BStructures cannot inherit a class but can implement an interface.
- CIn C#.NET, : is used to signify that a class member implements a specific interface.
- DAn interface can implement multiple classes.
- EThe static attribute can be used with a method that implements an interface declaration.
44Which of the following is the correct implementation of the interface given below? interface IMyInterface { double MyFun(Single i); }
- Aclass MyClass { double MyFun(Single i) as IMyInterface.MyFun { // Some code }}
- Bclass MyClass { MyFun (Single i) As Double {// Some code } }
- Cclass MyClass: implements IMyInterface { double fun(Single si) implements IMyInterface.MyFun() { //Some code } }
- Dclass MyClass: IMyInterface { double IMyInterface.MyFun(Single i) { // Some code } }
45Which of the following statements is correct?
- AWhen a class inherits an interface it inherits member definitions as well as its implementations.
- BAn interface cannot contain the signature of an indexer.
- CInterfaces members are automatically public.
- DTo implement an interface member, the corresponding member in the class must be public as well as static.
46Which of the following statements are correct about an interface used in C#.NET? (Choose 3)
- AAn interface can contain properties, methods and events.
- BThe keyword must implement forces implementation of an interface.
- CInterfaces can be overloaded.
- DInterfaces can be implemented by a class or a struct.
- EEnhanced implementations of an interface can be developed without breaking existing code.
47Which of the following can implement an interface? (Choose 2)
- AData
- BClass
- CEnum
- DStructure
- ENamespace
48Which of the following statements is correct about the C#.NET code snippet given below? interface IMyInterface{ void fun1(); void fun2(); } class MyClass: IMyInterface { private int i; void IMyInterface.fun1() { // Some code } }
- AClass MyClass is an abstract class.
- BClass MyClass cannot contain instance data.
- CClass MyClass fully implements the interface IMyInterface.
- DInterface IMyInterface should be inherited from the Object class.
- EThe compiler will report an error since the interface IMyInterface is only partially implemented.
49Which of the following statements is correct about the C#.NET code snippet given below? interface IPerson{ String FirstName { get; set; } String LastName { get; set; } void Print(); void Stock(); int Fun(); }
- AProperties cannot be declared inside an interface.
- BThis is a perfectly workable interface.
- CThe properties in the interface must have a body.
- DSubroutine in the interface must have a body.
- EFunctions cannot be declared inside an interface.
50For the code snippet shown below, which of the following statements are valid? public class TestIndiaBix { public void TestSub<M> (M arg)
{ Console.Write(arg); }} class MyProgram { static void Main(string[]args) { TestIndiaBix bix = new TestIndiaBix(); bix.TestSub("Hello world "); bix.TestSub(4.2f); }}- AProgram will compile and on execution will print: Hello world
- BA non generic class Hello cannot have generic subroutine.
- CCompiler will generate an error.
- DProgram will generate a run-time exception.
- ENone of all.
Information
- Description
- Quiz on .NET(51-100), created by Rizabek Kabzhanov on 16/05/2018.
- Author
- Rizabek Kabzhanov
- Language
- English
- Views
- 72
- Rating
- 5.0 out of 5 · 1 rating Rate this quiz