Explore topic-wise MCQs in Technical Programming.

This section includes 623 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

401.

Which of these is a method used to clear all the data present in output buffers?

A. clear()
B. flush()
C. fflush()
D. close()
Answer» C. fflush()
402.

Choose the filemode method which is used to create a new output file with the condition that the file with same name if exists will destroy the old file:

A. FileMode.CreateNew
B. FileMode.Create
C. FileMode.OpenOrCreate
D. FileMode.Truncate
Answer» C. FileMode.OpenOrCreate
403.

Choose the filemode method which is used to create a new output file with the condition that the file with same name must not exist.

A. FileMode.CreateNew
B. FileMode.Create
C. FileMode.OpenOrCreate
D. FileMode.Truncate
Answer» B. FileMode.Create
404.

Which property among the following represents the current position of the stream?

A. long Length
B. long Position
C. int Length
D. all of the mentioned
Answer» B. long Position
405.

Which among the following is used for storage of unmanaged memory aspects?

A. BufferedStream
B. FileStream
C. MemoryStream
D. UnmanagedMemoryStream
Answer» E.
406.

Which among the following is used for storage of memory aspects?

A. BufferedStream
B. FileStream
C. MemoryStream
D. None of the mentioned
Answer» D. None of the mentioned
407.

Which of these data types is returned by every method of OutputStream?

A. int
B. float
C. byte
D. none of the mentioned
Answer» E.
408.

Which of these classes is used to read and write bytes in a file?

A. FileReader
B. FileWriter
C. FileInputStream
D. InputStreamReader
Answer» D. InputStreamReader
409.

Select the action of the method long seek()?

A. Attempts to readup to count bytes into buffer starting at buffer[offset]
B. Writes a single byte to an output stream
C. Sets the current position in the stream to the specified offset from specified origin and hence returns the new position
D. None of the mentioned
Answer» D. None of the mentioned
410.

Select the statements which define the stream.

A. A stream is an abstraction that produces or consumes information
B. A stream is linked to a physical device by the I/0 system
C. C# programs perform I/O through streams
D. All of the mentioned
Answer» E.
411.

Name the method which returns integer as -1 when the end of file is encountered.

A. int read()
B. int ReadByte()
C. void readbyte()
D. none of the mentioned
Answer» C. void readbyte()
412.

Select the method which returns the number of bytes from the array buffer:

A. void WriteByte(byte value)
B. int Write(byte[] buffer ,int offset ,int count)
C. write()
D. none of the mentioned
Answer» C. write()
413.

Select the method which writes the contents of the stream to the physical device.

A. fflush()
B. void fflush()
C. void Flush()
D. flush()
Answer» D. flush()
414.

The method used to write a single byte to an output stream?

A. void WriteByte(byte value)
B. int Write(byte[] buffer ,int offset ,int count)
C. write()
D. none of the mentioned
Answer» B. int Write(byte[] buffer ,int offset ,int count)
415.

Choose the stream class method which is used to close the connection:

A. close()
B. static close()
C. void close()
D. none of the mentioned
Answer» D. none of the mentioned
416.

Choose the class on which all stream classes are defined?

A. System.IO.stream
B. Sytem.Input.stream
C. System.Output.stream
D. All of the mentioned
Answer» B. Sytem.Input.stream
417.

Select the namespace on which the stream classes are defined?

A. System.IO
B. System.Input
C. System.Output
D. All of the mentioned
Answer» B. System.Input
418.

Select the method used to write single byte to a file?

A. Write()
B. Wrteline()
C. WriteByte()
D. All of the mentioned
Answer» D. All of the mentioned
419.

Select the namespace/namespaces which consists of methods like Length(), Indexer(), Append() for manipulating the strings.

A. System.Class
B. System.Array
C. System.Text
D. None of the mentioned
Answer» D. None of the mentioned
420.

Which of these classes is used to create an object whose character sequence is mutable?

A. String()
B. StringBuilder()
C. String() & StringBuilder()
D. None of the mentioned
Answer» C. String() & StringBuilder()
421.

Choose the correct statement about the WriteLine()?

A. Can display one or more value to the screen
B. Adds a newline character at the end of the each new output
C. Allows to output data in as many different formats
D. All of the mentioned
Answer» E.
422.

Select the objects of the class TextWriter which is/are not used to perform the write operations to the console?

A. Write()
B. WriteLine()
C. WriteError()
D. All of the mentioned
Answer» D. All of the mentioned
423.

Name the method/methods used to read byte streams from the file?

A. ReadByte()
B. Read
C. Readkey()
D. None of the mentioned
Answer» B. Read
424.

What is the output returned by Console if ReadLine() stores I/O error?

A. 1
B. 0
C. False
D. I/O EXCEPTION ERROR
Answer» E.
425.

Which method in Console enables to read individual inputs directly from the keyboard in a non line buffered manner?

A. Read()
B. ReadKey()
C. ReadLine()
D. All of the mentioned
Answer» C. ReadLine()
426.

Which among the following methods are used to write characters to a string?

A. StreamWriter
B. StreamReader
C. StringWriter
D. None of the mentioned
Answer» D. None of the mentioned
427.

Which of these method used to read strings from the console?

A. get()
B. getline()
C. read()
D. readLine()
Answer» E.
428.

Which of these methods are used to read single character from the console?

A. get()
B. getline()
C. read()
D. readLine()
Answer» D. readLine()
429.

Name the exception thrown by read() on failure.

A. InterruptedException
B. SystemException
C. SystemInputException
D. I/O Exception
Answer» E.
430.

Choose the methods provided by Console.Out and Console.Error?

A. Write
B. WriteLine
C. WriteKey
D. Write & WriteLine
Answer» E.
431.

Choose the object/objects defined by the Textwriter class.

A. Console.In
B. Console
C. Console.Error
D. None of the mentioned
Answer» D. None of the mentioned
432.

Choose the object of TextReader class.

A. Console.In
B. Console.Out
C. Console.Error
D. None of the mentioned
Answer» B. Console.Out
433.

Choose the output returned when error condition is generated while read() reads from the console.

A. False
B. 0
C. -1
D. All of the mentioned
Answer» D. All of the mentioned
434.

Choose the output returned when read() reads the character from the console?

A. String
B. Char
C. Integer
D. Boolean
Answer» D. Boolean
435.

Select the correct methodS provided by Console.In?

A. Read(), ReadLine()
B. ReadKey(), ReadLine()
C. Read(), ReadLine(), ReadKey()
D. ReadKey(), ReadLine()
Answer» D. ReadKey(), ReadLine()
436.

The number of input methods defined by the stream method Console.In in C#.NET is?

A. 4
B. 3
C. 2
D. 1
Answer» C. 2
437.

Which of the given stream methods provide the access to the input console in C#.NET?

A. Console.Out
B. Console.Error
C. Console.In
D. All of the mentioned
Answer» D. All of the mentioned
438.

Which of the given stream methods provide access to the output console by default in C#.NET?

A. Console.In
B. Console.Out
C. Console.Error
D. All of the mentioned
Answer» C. Console.Error
439.

Which of the classes provide the operation of reading from and writing to the console in C#.NET?

A. System.Array
B. System.Output
C. System.ReadLine
D. System.Console
Answer» E.
440.

Attributes could be applied to

A. Method
B. Class
C. Assembly
D. All of the mentioned
Answer» E.
441.

Which of the following is the correct statement about inspecting an attribute in C#.NET?

A. An attribute can be inspected at link time
B. An attribute can be inspected at design time
C. An attribute can be inspected at run time
D. None of the mentioned
Answer» B. An attribute can be inspected at design time
442.

Select the correct statement about Attributes used in C#.NET?

A. The CLR can change the behaviour of the code depending on attributes applied to it
B. If a bugFixAttribute is to receive three parameters, then the BugFixAttribute class should implement a zero argument constructor
C. To create a custom attribute we need to create a custom attribute structure and derive it from System.Attribute
D. None of the mentioned
Answer» B. If a bugFixAttribute is to receive three parameters, then the BugFixAttribute class should implement a zero argument constructor
443.

Which among the following cannot be a target for a custom attribute?

A. Enum
B. Event
C. Interface
D. Namespace
Answer» E.
444.

The correct method to pass parameter to an attribute is?

A. By name
B. By address
C. By value
D. By reference
Answer» B. By address
445.

To apply an attribute to an Assembly, the correct way of implementation is?

A. [AssemblyInfo: AssemblyDescription (“Csharp”)].
B. [assembly: AssemblyDescription(“Csharp”)].
C. AssemblyDescription(“Csharp”)].
D. (Assembly:AssemblyDescription(“Csharp”)].
Answer» C. AssemblyDescription(“Csharp”)].
446.

Which of the following cannot further inspect the attribute that is once applied?

A. Linker
B. ASP.NET Runtime
C. Language compilers
D. CLR
Answer» B. ASP.NET Runtime
447.

Which of the keywords are used for the block to be examined for exceptions?

A. try
B. catch
C. throw
D. check
Answer» B. catch
448.

Choose the statement which is incorrect?

A. try block does not need to be followed by catch block
B. try block can be followed by finally block instead of catch block
C. try can be followed by both catch and finally block
D. try need not to be followed by anything
Answer» E.
449.

Which of these classes is related to all the exceptions that are explicitly thrown?

A. Error
B. Exception
C. Throwable
D. Throw
Answer» D. Throw
450.

Which of the following keywords is used by the calling function to guard against the exception that is thrown by called function?

A. try
B. throw
C. throws
D. catch
Answer» D. catch