.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Mphasis Placement Papers » Mphasis Previous Year Placement Paper

 

Mphasis Placement Paper -: .Net Questions With Answers


Advertisements
Advertisements




Mphasis Previous Years Solved Sample Placement Papers

  1. Which keyword is used to define a class in C#?

    A: Class

    B: class

    C: System.Class

    D: OOPS.class

    Ans: B

    Explanation:

    The class keyword is used to define a class in C#.

    Syntax:
    class class_name
    {
      // Class Definition
    }
        
  2. Which is the correct way to declare an object of the class in C#?

    A: Class_Name Object_Name = new Class_Name();

    B: Class_Name Object_Name;

    C: new Object_Name as Class_Name();

    D: Both A and B

    Ans: A

    Explanation:

    The correct way to declare an object of the class in C# is:

    Class_Name Object_Name = new Class_Name();
        

    Example:

    using System;
    
    namespace MyApplication {
      class Mobiles {
        string brand = "Apple";
    
        static void Main(string[] args) {
          Mobiles mobile = new Mobiles();
          Console.WriteLine(mobile.brand);
        }
      }
    }
    // Output: Apple
        
  3. Which operator is used to access variables/fields inside a class in C#?

    A: Arrow Operator (->)

    B: Dot Operator (.)

    C: Greater Than (>)

    D: Dot and Greater Than (.>)

    Ans: B

    Explanation:

    The dot (.) operator is used to access variables/fields in a class in C#.

    Syntax:
    Class_Name.Variable_Name/Field_Name;
        
  4. Is overriding of a function possible in the same class in C#?

    A: Yes

    B: No

    Ans: B

    Explanation:

    No, overriding of a function is not possible in the same class in C#. The override modifier is required to extend or modify the implementation of an inherited method.

  5. Which is not a type of constructor in C#?

    A: Static Constructor

    B: Private Constructor

    C: Body Constructor

    D: Parameterized Constructor

    Ans: C

    Explanation:

    There are 5 types of constructors in C#: Static, Private, Copy, Default, and Parameterized constructors.

  6. How many types of access modifiers in C#?

    A: 2

    B: 3

    C: 4

    D: 5

    Ans: C

    Explanation:

    In C#, there are 4 types of access modifiers: public, private, protected, and internal.

  7. What does the access modifier do in C#?

    A: To maintain the syntax

    B: To define a variable inside the class

    C: To access the variables defined inside the class

    D: To control the visibility of class members

    Ans: D

    Explanation:

    Access modifiers control the visibility of class members, providing a security level for each individual class and member.

  8. The internal access modifier is used for ___.

    A: Types and type members

    B: Defining a field that can be accessed in all classes

    C: Defining a field that can be accessed in inherited classes

    D: All of the above

    Ans: A

    Explanation:

    The internal access modifier is used for types and type members. They are accessible only within files in the same assembly.

  9. The protected access modifier defines a member that can be accessible within ___.

    A: its class and all other classes

    B: its class and by derived class instances

    C: its class only

    D: None of the above

    Ans: B

    Explanation:

    The protected access modifier defines a member that can be accessible within its class and by derived class instances.

  10. Does C# support multiple inheritance?

    A: Yes

    B: No

    Ans: B

    Explanation:

    No, C# does not support multiple class inheritance.

  11. Which C# concept has the capability of an object to take a number of different forms and hence display behavior accordingly?

    A: Polymorphism

    B: Encapsulation

    C: Abstraction

    D: None of the above

    Ans: A

    Explanation:

    Polymorphism allows an object to take on multiple forms and display different behaviors accordingly.

  12. What will be the output of the following C# code?

    using System;
    
    namespace MyApplication {
      public class Class1 {
        public static int x = 10;
      }
      public class Class2: Class1 {
        public static int x = 20;
        static void Main(string[] args) {
          Console.WriteLine(x + ", " + Class1.x);
        }
      }
    }
        

    A: 20, 20

    B: 10, 10

    C: 20, 10

    D: Exception

    Ans: C

    Explanation:

    The code prints the value of x in Class2 and Class1.x, resulting in "20, 10".

  13. What is the C# keyword which is used to change data and behavior of a base class by replacing a member of the base class with a new derived member?

    A: overrides

    B: protected

    C: base

    D: new

    Ans: D

    Explanation:

    The new keyword is used to change data and behavior of a base class by replacing a member with a new derived member.




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy