.
  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. What is the use of 'throw' statement in C#?

    A: to return from the calling functions to called function

    B: to throw an exception manually during the execution of the program

    C: to return from the switch statement

    D: None of the above

    Ans: B

    Explanation:

    The C# throw statement is used to throw an exception manually during the execution of the program.

  2. Which C# keyword is used to coming out from the loop?

    A: break

    B: continue

    C: Both A and B

    D: None of the above

    Ans: A

    Explanation:

    The C# break keyword breaks the execution of the loop and sends the program’s control to the next statement written after the loop.

  3. What is String in C# meant for?

    A: A variable

    B: A Class

    C: An Array

    D: An object

    Ans: D

    Explanation:

    In C#, String is an object of System.String class.

  4. Can we use == operator to compare two strings?

    A: Yes

    B: No

    Ans: A

    Explanation:

    Two strings can be compared by using the == Operator.

  5. Which is the base class of the String() Constructor?

    A: String

    B: System.IO.String

    C: System.Strings

    D: System.String

    Ans: D

    Explanation:

    In C#, System.String is a base class for all String related methods, properties, constructors, and operators.

  6. Which String class operator is used to determine whether two specified strings have different values?

    A: !=

    B: !

    C: ~

    D: ~

    Ans: A

    Explanation:

    In C#, the inequality operator (!=) can be used to determine whether two specified strings have different values.

  7. Except == operator, which methods can be used to compare two strings?

    A: Equals()

    B: Compare()

    C: Both A and B

    D: None of these

    Ans: C

    Explanation:

    The Equals() and Compare() methods can also be used to compare two strings in C#.

  8. Which is the correct method to convert given string in uppercase?

    A: Upper()

    B: ToUpper()

    C: Upr()

    D: ToUpr()

    Ans: B

    Explanation:

    The ToUpper() method is used to convert the given string into the uppercase.

    using System;
    
    class Program {
      public static void Main() {
        string str = "includehelp";
        Console.WriteLine(str.ToUpper());
      }
    }
        
  9. What is String.Length in C#?

    A: Property

    B: Method

    C: Constructor

    D: Both A and B

    Ans: A

    Explanation:

    The String.Length is a property of System.String class that is used to get the number of characters in the current String object.

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

    using System;
    
    class Program {
      static void Main(string[] args) {
        String s1 = "Hello";
        String s2 = "IncludeHelp";
        String s3 = s1;
        Console.WriteLine(s1.Equals(s3) + "  " + s2.CompareTo(s1));
      }
    }
        

    A: Error

    B: True True

    C: True False

    D: True 1

    Ans: D

    Explanation:

    The Equals() method returns a bool value. We assigned s1 to s3. Thus, the statement s1.Equals(s3) will return "True". The CompareTo() method returns an int value, and s2.CompareTo(s1) will return 1 because this instance (s2) follows s1.

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

    using System;
    
    class Program {
      static void Main(string[] args) {
        String str = "Hello";
        Console.WriteLine(str.Length);
      }
    }
        

    A: 5

    B: 6

    C: 7

    D: 4

    Ans: A

    Explanation:

    The String.Length returns the length of the string. Thus, the output will be 5.

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

    using System;
    
    class Program {
      static void Main(string[] args) {
        String str = "Hello";
        Console.WriteLine(str.IndexOf('h'));
      }
    }
        

    A: 0

    B: 1

    C: -1

    D: Error

    Ans: C

    Explanation:

    The IndexOf() method returns the index of a given character, and it returns -1 if the given character is not found in the string. Here, we are trying to get the index of 'h' which is not present in the string. Thus, the output will be -1.




 


.

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