Author name: admin

C# Inheritance MCQ

1. What is inheritance in C#? a) The process of creating new classes from existing ones b) Copying the same method into multiple classes c) Using the same variables in different classes d) Connecting classes through interfaces Click to View Answer and Explanation Answer: a) The process of creating new classes from existing ones Explanation: […]

C# Inheritance MCQ Read More »

C# OOP MCQ

1. What is encapsulation in C#? a) Breaking a program into multiple parts b) Hiding the internal state of an object and requiring all interaction to be performed through an object's methods c) The ability of a class to extend the functionality of another class d) A class that can be used to create objects

C# OOP MCQ Read More »

C# Methods MCQ

1. How do you define a method in C#? a) dataType methodName(parameters) { /* code */ } b) method dataType methodName(parameters) { /* code */ } c) dataType methodName = (parameters) { /* code */ } d) function dataType methodName(parameters) { /* code */ } Click to View Answer and Explanation Answer: a) dataType methodName(parameters)

C# Methods MCQ Read More »

C# For Loop MCQ

1. What is the basic syntax of a for loop in C#? a) for (initialization; condition; iteration) { /* code */ } b) for (condition; initialization; iteration) { /* code */ } c) for (initialization; iteration; condition) { /* code */ } d) for where (initialization; condition; iteration) { /* code */ } Click to

C# For Loop MCQ Read More »

C# Switch MCQ

1. Which of the following is the correct syntax for a switch statement in C#? a) switch(variable) { case value: /* code */ } b) switch variable { case value: /* code */ } c) switch(variable) { when value: /* code */ } d) switch(variable) { if value: /* code */ } Click to View

C# Switch MCQ Read More »

C# Arrays MCQ

1. How do you declare an array of integers in C#? a) int[] myArray; b) array<int> myArray; c) int myArray[]; d) int array[] myArray; Click to View Answer and Explanation Answer: a) int[] myArray; Explanation: In C#, arrays are declared with the type followed by square brackets, as in int[]. 2. What will be the

C# Arrays MCQ Read More »

C# Strings MCQ

1. How do you concatenate strings in C#? a) Using the '+' operator b) Using the '&' operator c) Using the concat() method d) Using the append() method Click to View Answer and Explanation Answer: a) Using the '+' operator Explanation: In C#, strings are commonly concatenated using the '+' operator. 2. What method is

C# Strings MCQ Read More »

JavaScript Modules MCQ

1. What are JavaScript modules? a) Pre-built JavaScript libraries b) JavaScript files that export and import functionality c) Functions within JavaScript d) HTML elements linked to JavaScript Click to View Answer and Explanation Answer: b) JavaScript files that export and import functionality Explanation: JavaScript modules are files that can export parts of their code (like

JavaScript Modules MCQ Read More »

JavaScript DOM MCQ

1. What does DOM stand for in JavaScript? a) Document Object Model b) Display Object Management c) Data Object Model d) Document Orientation Model Click to View Answer and Explanation Answer: a) Document Object Model Explanation: DOM stands for Document Object Model, which is a programming interface for web documents. It represents the page so

JavaScript DOM MCQ Read More »

Scroll to Top