Online C# Programming Test - C# Programming Test - Random
Instruction:
- This is a FREE online test. Beware of scammers who ask for money to attend this test.
- Total number of questions: 20.
- Time allotted: 30 minutes.
- Each question carries 1 mark; there are no negative marks.
- DO NOT refresh the page.
- All the best!
Marks : 2/20
Total number of questions
20
Number of answered questions
0
Number of unanswered questions
20
Test Review : View answers and explanation for this test.
1.
Which of the following assemblies can be stored in Global Assembly Cache?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
2.
Which of the following security features can .NET applications avail?
- PIN Security
- Code Access Security
- Role Based Security
- Authentication Security
- Biorhythm Security
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
3.
Which of the following statements are correct about the Bitwise & operator used in C#.NET?
- The & operator can be used to Invert a bit.
- The & operator can be used to put ON a bit.
- The & operator can be used to put OFF a bit.
- The & operator can be used to check whether a bit is ON.
- The & operator can be used to check whether a bit is OFF.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Operators
4.
Which of the following statements are correct about the following code snippet?
int a = 10;
int b = 20;
bool c;
c = !(a > b);
- There is no error in the code snippet.
- An error will be reported since ! can work only with an int.
- A value 1 will be assigned to c.
- A value True will be assigned to c.
- A value False will be assigned to c.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Operators
5.
A function returns a value, whereas a subroutine cannot return a value.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Functions and Subroutines
6.
How can you prevent inheritance from a class in C#.NET ?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Explanation:
C#.NET allows sealed attribute to be used as a part of class statement. Classes declared with sealed keyword cannot be used as based class for other classes. Most important reason to do this world be to prevent behavior of a class to be changed in any way.
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
7.
Which statement will you add in the function fun() of class B, if it is to produce the output "Welcome to IndiaBIX.com!"?
namespace IndiabixConsoleApplication
{
class A
{
public void fun()
{
Console.Write("Welcome");
}
}
class B: A
{
public void fun()
{
// [*** Add statement here ***]
Console.WriteLine(" to IndiaBIX.com!");
}
}
class MyProgram
{
static void Main (string[ ] args)
{
B b = new B();
b.fun();
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
8.
Which of the following statements are correct about arrays used in C#.NET?
- Arrays can be rectangular or jagged.
- Rectangular arrays have similar rows stored in adjacent memory locations.
- Jagged arrays do not have an access to the methods of System.Array Class.
- Rectangular arrays do not have an access to the methods of System.Array Class.
- Jagged arrays have dissimilar rows stored in non-adjacent memory locations.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Arrays
9.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "Five Star";
String s2 = "FIVE STAR";
int c;
c = s1.CompareTo(s2);
Console.WriteLine(c);
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Strings
10.
Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?
struct Address
{
private int plotno;
private String city;
}
Address a = new Address();
Address b;
b = a;
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Structures
11.
Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main(string[] args)
{
Sample x = new Sample();
x.i = 10;
fun(ref x);
Console.Write(x.i + " ");
}
public static void fun(ref Sample y)
{
y.i = 20;
Console.Write(y.i + " ");
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Structures
12.
Creating empty structures is allowed in C#.NET.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Structures
13.
Which of the following is the necessary condition for implementing delegates?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
14.
Which of the following statements are correct about enum used in C#.NET?
- Every enum is derived from an Object class.
- Every enum is a value type.
- There does not exist a way to print an element of an enum as a string.
- Every enum is a reference type.
- The default underlying datatype of an enum is int.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Enumerations
15.
How many enumerators will exist if four threads are simultaneously working on an ArrayList object?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Collection Classes
16.
Which of the following statements are correct about the Collection Classes available in Framework Class Library?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Collection Classes
17.
If ListBox is class present in System.Windows.Forms namespace, then which of the following statements are the correct way to create an object of ListBox Class?
using System.Windows.Forms; ListBox lb = new ListBox();
using LBControl = System.Windows.Forms; LBControl lb = new LBControl();
System.Windows.Forms.ListBox lb = new System.Windows.Forms.ListBox();
using LBControl lb = new System.Windows.Forms.ListBox;
using LBControl = System.Windows.Forms.ListBox; LBControl lb = new LBControl();
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Namespaces
18.
Which of the following statements are correct about the exception reported below?
Unhandled Exception: System.lndexOutOfRangeException: Index was outside the bounds of the array: at IndiabixConsoleApplication.MyProgram.SetVal(Int32 index, Int32 val) in D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 26 at IndiabixConsoleApplication.MyProgram.Main(String[] args) in D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 20
Unhandled Exception: System.lndexOutOfRangeException: Index was outside the bounds of the array: at IndiabixConsoleApplication.MyProgram.SetVal(Int32 index, Int32 val) in D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 26 at IndiabixConsoleApplication.MyProgram.Main(String[] args) in D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 20
- The CLR failed to handle the exception.
- The class MyProgram belongs to the namespace MyProgram.
- The function SetVal() was called from Main() in line number 20.
- The exception occurred in line number 26 in the function SetVal()
- The runtime exception occurred in the project IndiabixConsoleApplication.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Exception Handling
19.
Which of the following statements are correct about an interface used in C#.NET?
- An interface can contain properties, methods and events.
- The keyword must implement forces implementation of an interface.
- Interfaces can be overloaded.
- Interfaces can be implemented by a class or a struct.
- Enhanced implementations of an interface can be developed without breaking existing code.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Interfaces
20.
A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Interfaces
*** END OF THE TEST ***
Time Left: 00:29:56
Post your test result / feedback here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers