Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in /home/dump4cer/public_html/guide4certs/Core/Common/Funs.php on line 181
 98-372 Exam | 98-372 PDF | 98-372 VCE | 98-372 - Study Guide | 98-372 Braindumps | Microsoft Exam Dumps - Guide4Certs

98-372 Exam

Microsoft .NET Fundamentals

  • Exam Number/Code : 98-372
  • Exam Name : Microsoft .NET Fundamentals
  • Questions and Answers : 230 Q&As
  • Update Time: 2017-11-13
  • Price: $ 99.00 $ 39.00

What Guide4Certs Offer for Microsoft 98-372

We provide 98-372 questions with answers for passing your Microsoft Microsoft Windows Server 98-372 exam (Microsoft .NET Fundamentals) quickly with 90 days free updates and money back guarantee if you fail in exam unfortunately. Please see the guarantee page on top manu for more details.

 

Exam Description or Exam Demo

 Question: 1

What are the steps required to read text from a file?
Answer:
Explanation:
The steps required to read text from a file are as follows:
1.Implement the System.IO namespace using the following code.
using System.IO;
2.Create a StreamReader class object and initialize it with a file name.
StreamReader sr = new StreamReader("TestFile.txt");
or
StreamReader sr;
sr = new StreamReader("TestFile.txt");
3.Create a string object that temporarily stores the text to be read from the file.
String line;
4.Insert a while statement to read the text from starting to the end of the file using the ReadLine()
method, and display the text.
While(line=sr.ReadLine()!=NULL)
{
}
5.Now, close the StreamReader class.
sr.Close();
Question: 2
Which element is NOT required if you need a custom class to raise an event?
A. A method to add an event handler
B. A class containing event data, derived from EventArgs
C. A delegate for the event
D. A class raising the event
Answer: A
Explanation:
You do not need a method to add an event handler because that functionality is provided by the
.NET Framework.
An event handler is a course of action in program code and it is performed when an event occurs.
Therefore, when an event is raised, the code within the event handler is executed. In order to handle
an event, the event handler provides two parameters. The first parameter passes a reference to the
object that raised the event, and the second parameter passes an object specific to the event that is
being handled by the event handler. Event handlers can be created using the Windows Forms
Designer as well as during runtime.
Answer: C, D, and B are incorrect. If you are required to raise an event in a custom class, you need a
class that contains the event data, either EventArgs or a class inheriting from EventArgs, a delegate
for the event, and a class raising the event.
Question: 3
Which class is used to write primitive types in binary to a stream and supports writing strings in a
specific encoding?
A. TextReader class
B. BinaryReader class
C. BinaryWriter class
D. TextWriter class
Answer: C
Explanation:
strings in a specific encoding. Any derived class can override the methods of the BinaryWriter class
to give distinctive character encodings.
Answer: A is incorrect. The TextReader class exposes a reader that can read a sequential series of
characters.
Answer: D is incorrect. The TextWriter class exposes a writer that can write a sequential series of
characters.
Answer: B is incorrect. The BinaryReader class is used to read primitive data types as binary values in
a specific encoding. Characters can be read from the stream using the given encoding system. The
default encoding system is equal to New UTF8Encoding.
Question: 4
You are creating an application using .NET Framework 4.0. You write the following code segment in
the application.
class CompGenerate
where T : IComparable
{
public T t1;
public T t2;
public CompGenerate(T _t1, T _t2)
{
t1 = _t1;
t2 = _t2;
}
}
Given the above class declaration, which of the following constructors is correct?
A. CompGenerate gen = new CompGenerate();
B. CompGenerate gen = new CompGenerate(10.125, 2005);
C. CompGenerate gen = new CompGenerate(10.125, 2005);
D. CompGenerate
Answer: C
Explanation:
The following constructor is correct:
CompGenerate gen = new CompGenerate(10.125, 2005);
The given class declaration is a generic. Therefore, in order to create a generic, you need to provide
a type for each generic type, and that type must meet all constraints.
The .NET Framework version has provided a new feature of generics that introduce to the .NET
Framework the concept of type parameters, which make it possible to design classes and methods
that postpone the specification of one or more types until the class or method is declared and
instantiated by client code. For instance, by using a generic type parameter T, a single class can be
operations. The following are the benefits of using generics:
1.Generic types are used to maximize the reusability of code, type safety, and performance of .NET
applications.
2.Generics are used to create new generic collection classes contained in the
System.Collections.Generic namespace.
3.Custom generics can be created that include generic interfaces, classes, methods, events and
delegates.
4.The type information used in a generic data type can be obtained by reflection during runtime.
5.Generics enable the compiler to catch type-casting errors during compilation.
6.Generics do not require casting or boxing, and therefore, it improves runtime performance.
Answer: A is incorrect. In order to create an instance of a generic class, you need to provide
parameter values. This constructor does not provide parameter values.
Answer: D is incorrect. The given class declaration only specifies a single generic type. This
constructor provides two generic types.
Answer: D is incorrect. The given class declaration only specifies a single generic type. This
constructor provides two generic types.
Answer: B is incorrect. In order to create an instance of a generic class, you need to provide a type.
This constructor does not provide a type.
Question: 5
Which class is a byte of data that reads and writes from and to a disk?
A. StringReader class
B. TextReader class
C. XmlTextReader class
D. Stream class
Answer: D
Explanation:
A stream is a byte of data that reads and writes from and to a disk. The .NET Framework 2.0 provides
the System.IO.Stream class as the base class for all the task-related stream data types. To read data
in bytes is to transfer it from a stream into a data structure. To write data in bytes is to transfer it
from a data structure into a stream. Streams support seeking, which queries and modifies the
current position of data within a stream.
Answer: A is incorrect. The StringReader class is used to implement a TextReader that reads from a
string. It constructs and initializesa new instance of the StringReader class that reads from the
specified string. It consists of the following methods:
Close
Dispose
Peek
Read(char[], int, int)
Read
ReadLine
Answer: C is incorrect. The XmlTextReader class requires fast access to XML data. It does not require
reading the entire document into memory via the Document Object Model (DOM). The class is
derived from the XmlReader class and implements all the methods defined in the XmlReader class.
The following are the functions of the XmlTextReader class:
It enforces rules of a well-formed XML document.
It does not provide any data validation in a document.
It checks the Document Type Definition (DTD) and DocumentType nodes for their well-formed
structure, but does not validate these nodes by using the DTD.
Answer: B is incorrect. The TextReader class is used to provide a reader that can read a sequential
chain of characters. It is the abstract base class of the StreamReader and StringReader classes. These
derived classes can be used to open a text file for reading a specified range of characters, or to
create a reader based on an existing stream. A derived class must at least implement the Peek and
Read methods to make a functional instance of the TextReader class.
Question: 6
Namespaces are used a lot in C# programming in two ways.
What are those two ways?
Each correct answer represents a part of the solution. Choose two.
A. Use the namespace keyword to declare a namespace
B. Declaring your own namespaces
C. The .NET Framework uses namespaces to organize its many classes
D. Using global namespace
Answer: C and B
Explanation:
First, the .NET Framework uses namespaces to organize its many classes as follows:
System.Console.WriteLine("Hello World!");
Here, System is a namespace and Console is a class in the namespace. The using keyword is used to
avoid using the complete name. An example is given below:
using System;
//No need to put System before Console
Console.WriteLine("Hello");
Console.WriteLine("World!");
Second, declaring your own namespaces can help you to control the scope of class and method
names in larger programming projects. The namespace keyword is used to declare a namespace, as
in the following example:
namespace SampleNamespace
{
class SampleClass
{
public void SampleMethod()
System.Console.WriteLine("SampleMethod inside SampleNamespace");
}
}
}
Question: 7
You are creating an application using .NET Framework 4.0. You need to use a last-in, first-out
collection in the application. Which of the following is a last-in, first-out collection?
A. Queue
B. List
C. Stack
D. Hash
Answer: C
Explanation:
The Stack collection is a last-in, first-out collection. A stack is the Last in First Out (LIFO) abstract data
type and data structure. It can have any abstract data type as an element. However, a stack is
characterized by only two basic operations: push and pop. The push operation is used to add an item
to the top of the stack, hiding any items already on the stack, or initializing the stack if it is empty.
The pop operation is used to remove an item from the top of the stack, and returns this value to the
caller. A pop either exposes previously hidden items or results in an empty stack.
A stack is a restricted data structure, as only a limited number of operations are carried out on it.
The nature of the pop and push operations also indicates that the stack elements have a natural
order. The elements are removed from the stack in the reverse order to the order of their addition.
Consequently, the lower elements are those that have been on the stack the longest.
Answer: A is incorrect. The Queue class is a first-in, first-out collection.
Answer: B is incorrect. The List class does not support ordered retrieval.
Answer: D is incorrect. The Hash class offers evidence about the hash value for an assembly. The
hash value signifies a distinct value that corresponds to a specific set of bytes. The hash value
designates the assembly without ambiguity, instead of referring to the assembly by name, version,
or other designation. Names are subject to collisions in exceptional cases where the identical name
is specified to totally different code. Different variations of code can unintentionally be marked with
the identical version. However, changing a single bit might result in a very different hash value. The
Hash class cannot be inherited.
Question: 8
How is an XmlWriter object useful when writing XML data to XML documents? Each correct answer
represents a complete solution. Choose all that apply.
A. It ensures that XML data is represented in file format.
B. It ensures that an XML document is well-formed.
C. It allows XML values to be passed as parameters by using CLR types instead of using strings.
D. It ensures that XML characters are legal and contains valid element and attribute names.
Answer: B, D, and C
Explanation:
The XmlWriter class is used to create streams and write data to XML documents. An XmlWriter
object of the class is useful when writing an XML data to XML documents in the following manner:
An XmlWriter object ensures that XML characters are legal and contains valid element and attribute
names.
It ensures that an XML document is well-formed.
It allows encoding of binary data into bytes such as Base64 or BinHex, and writing the resulting data.
It allows XML values to be passed as parameters by using CLR types instead of using strings. This
avoids value conversions manually.
It allows multiple XML documents to be written to one output stream.
Question: 9
What are the benefits of asymmetric key cryptography? Each correct answer represents a complete
solution. Choose all that apply.
A. It is not scalable.
B. Key regeneration is not required when a user's private key is compromised.
C. Asymmetric algorithms provide a key revocation mechanism.
D. The same key pair is required to have effective communication with all the users of the
asymmetric cryptosystem.
Answer: D and C
Explanation:
The benefits of asymmetric key cryptography are as follows:
The benefits of asymmetric key cryptography are as follows:
1.Same key pair is required to have effective communication with all the users of the asymmetric
cryptosystem. This makes the algorithm extremely scalable.
effectively removed from the system by allowing the cancellation of a key.
3.Key regeneration is needed only when a user's private key is compromised. The system
administrator invalidates the user's keys if the user leaves the community. During this task, the other
keys are not compromised.
4.Asymmetric key encryption provides integrity, authentication, and nonrepudiation. A message
signed by the users cannot be repudiated later, if their private key is not shared with the other
individuals.
5.Key distribution is a simple process. Users make their public key available to anyone with whom
they want to communicate. It is not possible to derive the private key from the public key.
Question: 10
You are creating an application using .NET Framework 4.0. You need to provide standard parameters
for an event handler delegate. Which of the following are standard parameters for the event handler
delegate?
Each correct answer represents a complete solution. Choose all that apply.
A. Event
B. Delegate
C. EventHandler
D. EventArgs
E. Object
Answer: E and D
Explanation:
The EventHandler delegate exposes a method that will handle an event having no event data. The
event model in the .NET Framework is based on having an event delegate that connects an event
with its handler. In order to raise an event, two elements are required, which are as follows:
A delegate identifying the method that provides the response to the event
A class containing the event data
The delegate is a type that defines a signature, i.e., the return value type and parameter list types for
a method. The delegate type can be used to declare a variable that can refer to any method with the
identical signature as the delegate.
The standard signature of an event handler delegate is used to define a method that does not return
a value. The first parameter of the method is of type Object and refers to the instance that raises the
event, and the second parameter is inherited from type EventArgs and contains the event data. If
the event does not generate event data, the second parameter is just an instance of EventArgs.
Otherwise, the second parameter is a custom type derived from EventArgs and provides any fields or
properties required to contain the event data.
EventHandler is a predefined delegate that purposely represents an event handler method for an
event that does not generate data. If the event does generate data, a custom event data type must
be supplied, either create a delegate where the type of the second parameter is a custom type, or
generic type parameter.
However, in order to associate the event with the method that will handle the event, an instance of
the delegate is added to the event.
The event handler is invoked whenever the event takes place, unless the delegate is removed.
The EventArgs class is the base class for classes that hold event data. The EventArgs class holds no
event data. It is used by events that do not pass state information to an event handler whenever an
event is raised. If the event handler needs state information, the application must inherit a class
from the EventArgs class to hold the data. For instance, the AssemblyLoadEventArgs class holds the
data for assembly load events, and holds an Assembly class that describes the loaded assembly.
Answer: B is incorrect. The Delegate class is the base class for delegate types. It is not a parameter
for event handler delegates.
Answer: A is incorrect. The Event class is the base event for event types. It is not a parameter for
event handler delegates.
Question: 11
How will you define a default value, Yellow, for a simple element of the XML schema?
A.
B.
C.
D.
Answer: A
Explanation:
In XML schema, a default value is automatically assigned to the element when no other value is
specified. The following is the syntax for the default value for a simple element:
For example:
Here, the default value is "Yellow".
Answer: D, B, and C are incorrect. The values should be in double quote (") instead of a single quote
(').
Question: 12
Consider the following scenario.
Allen has created a Windows Presentation Foundation (WPF) database application using .NET
Framework 4.0. The application helps users keep track of their e-Book collection. He identifies that
some computers might have many users, such as two roommates might share a computer, with both
individuals using the same application on the same computer to manage their e-Book collections.
Allen sets up a database to handle many users without mixing up the collections. Allen has
implemented a very trendy system that allows users to alter the colors, fonts, and graphics in the
application, giving it a personalized look and feel. What is the file name of the configuration file
created by Visual Studio for Allen's application?
A. Machine.config
B. Setting.config
C. App.config
D. Web.config
Answer: C
Explanation:
App.config is the file name of the configuration file created by Visual Studio for Allen's application.
Since Allen's project is a Windows application, Windows Presentation Foundation (WPF) in this case,
Visual Studio will name the file app.config by default. However, a Web application will use
web.config.
The App.config (Application configuration) file is a .NET configuration file that consists of a chain of
settings specific to a Windows application. This file is usually located in the root directory of the
application that is being configured according to a particular computer.
Generally, the application configuration files override the configuration settings in the
Machine.config (Machine configuration) file.
Answer: B is incorrect. There is no such .config file as setting.config.
Answer: D is incorrect. Web.config is the main settings and configuration file for an ASP.NET Web
application. The file is an XML document that defines configuration information regarding the Web
application. It contains information that control module loading, security configuration, session state
configuration, and application language and compilation settings. Web.config files can also contain
application specific items, such as database connection strings. The example of Web.config is as
follows:
 
 
Answer: A is incorrect. The Machine.config file controls the configuration settings for the entire
computer. It includes settings specific to a computer, such as built-in remoting channels, machinefor
APIs and ASP .NET settings in the machine.config file. The default configuration of the .NET
Framework is declared in the Machine.config file.

Why Should you Buy Guide4Certs 98-372 Product

Quality and Value for the 98-372 Exam
98-372 Exam Free Demo Avaialble for you to check Exam Qestions and Pattern before you Purchase
100% Guarantee to Pass Your 98-372 Exam
98-372 90 Days Updates (FREE)
98-372 PDF Questions with Answers
98-372 Instant Download Right After Purchased
98-372 Drag and Drop questions as experienced in the Actual Exams
Guide4Certs Live Chat Support Available (7 Days a Week)

Guide4Certs 98-372 Exam Features

Quality and Value for the 98-372 Exam

Guide4Certs Practice Exams for Microsoft 98-372 are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development.

100% Guarantee to Pass Your 98-372 Exam

If you preparing for the exam using our Guide4Certs study Guide, we guarantee that you will succeed in the very first attempt. If you do not pass the Microsoft Windows Server 98-372 exam (Microsoft .NET Fundamentals) on your first attempt we will give you a FULL REFUND of your purchasing fee AND send you another same value product for free.

Microsoft 98-372 Downloadable, Printable Exams (in PDF format)

Our Exam 98-372 Study Guides provides you everything you will need to take your 98-372 Exam. The 98-372 Exam details are researched and produced by Professional Certification Experts who are constantly using industry experience to produce precise, logical and up to date exam study guides for you. You may get questions from different web sites or books, but concept is the key.Guide4Certs Product will help you not only pass in the first try, but also save your valuable time.

Our Microsoft 98-372 Exam will provide you with latest 98-372 dumps questions with verified answers that reflect the actual exam. These Questions and Answers will certainly help you in real exam and will boost your confidence before taking the actual test. High quality and Value for the 98-372 Exam:100% Guarantee to Pass Your Microsoft Windows Server exam and get your Microsoft Windows Server Certification.

http://www.Guide4Certs.com The Latest IT Certifications Guides to make it easier to get Microsoft Windows Server Exams.

>