This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Choose the statements which are false in nature?(a) The base class member functions can access public member functions of derived class(b) An object of a derived class cannot access private member of the base class(c) Private members of the base class cannot be accessed by derived class member functions or objects of derived class(d) None of the mentionedI had been asked this question during an interview for a job.My question is based upon Public & Private Access Modifier in section Arrays and Strings of C# |
|
Answer» Correct answer is (a) The base class MEMBER functions can ACCESS PUBLIC member functions of derived class |
|
| 2. |
Accessibility modifier defined in a class are?(a) public, private, protected(b) public, internal, protected internal(c) public, private, internal, protected internal(d) public, private, protected, internal, protected internalThe question was asked during a job interview.The question is from Public & Private Access Modifier topic in section Arrays and Strings of C# |
|
Answer» RIGHT OPTION is (d) PUBLIC, PRIVATE, protected, internal, protected internal The EXPLANATION: None. |
|
| 3. |
What is the process by which we can control parts of a program that can access the members of a class?(a) Polymorphism(b) Abstraction(c) Encapsulation(d) RecursionThis question was posed to me in unit test.Enquiry is from Public & Private Access Modifier in chapter Arrays and Strings of C# |
|
Answer» The CORRECT CHOICE is (C) Encapsulation |
|
| 4. |
Which of these base classes are accessible to the derived class members?(a) static(b) protected(c) private(d) SharedI have been asked this question in class test.The doubt is from Public & Private Access Modifier in section Arrays and Strings of C# |
|
Answer» RIGHT CHOICE is (B) protected Easiest EXPLANATION - NONE. |
|
| 5. |
Which of these is used to access members of class before the object of that class is created?(a) public(b) private(c) static(d) protectedI have been asked this question in an internship interview.My doubt is from Public & Private Access Modifier in division Arrays and Strings of C# |
|
Answer» RIGHT ANSWER is (C) static Explanation: NONE. |
|
| 6. |
Which of these is used as a default specifier for a member of the class if no access specifier is used for it?(a) private(b) public(c) public, within its own class(d) protectedThe question was asked in an online quiz.This key question is from Public & Private Access Modifier topic in portion Arrays and Strings of C# |
|
Answer» Correct option is (a) PRIVATE |
|
| 7. |
How is a string typically processed?(a) On a character by character basis(b) On a string by string basis(c) Both On a character by character basis & On a string by string basis(d) None of the mentionedI got this question in semester exam.I need to ask this question from Operation on Characters in portion Arrays and Strings of C# |
|
Answer» CORRECT CHOICE is (a) On a CHARACTER by character basis Best EXPLANATION: NONE. |
|
| 8. |
Which of these methods of class String is used to extract all the characters from a String object?(a) CHARAT()(b) Remove()(c) charAt()(d) Replace()This question was posed to me during an interview for a job.The doubt is from Operation on Characters in portion Arrays and Strings of C# |
|
Answer» Right choice is (b) Remove() |
|
| 9. |
Which of these methods can be used to convert all characters in a String into a character array?(a) CharAt()(b) getChars()(c) TocharArray()(d) All of the mentionedThe question was posed to me in a job interview.My question is from Operation on Characters topic in portion Arrays and Strings of C# |
|
Answer» CORRECT ANSWER is (c) TocharArray() Easy EXPLANATION - None. |
|
| 10. |
Which of these methods is an alternative to getChars() that stores the characters in an array of bytes?(a) getBytes()(b) GetByte()(c) giveByte()(d) Give Bytes()I have been asked this question in an internship interview.The question is from Operation on Characters topic in portion Arrays and Strings of C# |
|
Answer» Correct option is (a) getBytes() |
|
| 11. |
Which of these methods of the class String is used to obtain length of String object?(a) get()(b) Sizeof()(c) lengthof()(d) length()The question was asked in an online interview.My question is from Operation on Characters in section Arrays and Strings of C# |
|
Answer» Correct OPTION is (d) length() |
|
| 12. |
What is the value returned by function compareTo() if the invoking string is less than the string compared?(a) zero(b) value less than zero(c) value greater than zero(d) none of the mentionedI have been asked this question at a job interview.I would like to ask this question from Comparison of Strings in division Arrays and Strings of C# |
|
Answer» Correct answer is (b) value LESS than zero |
|
| 13. |
Which of these methods returns the string such that some characters which are specified to be removed from the end of strings are removed from string by mentioning the number of characters to be removed?(a) Trim()(b) Remove()(c) TrimEnd()(d) Split()This question was addressed to me at a job interview.Enquiry is from Comparison of Strings in division Arrays and Strings of C# |
|
Answer» The correct answer is (a) Trim() |
|
| 14. |
Which of these methods of class String is used to check whether a substring exists at the beginning of the particular string?(a) StartsWith()(b) EndsWith()(c) Starts()(d) ends()The question was asked in an interview for job.I'm obligated to ask this question of Comparison of Strings in section Arrays and Strings of C# |
|
Answer» The correct option is (a) StartsWith() |
|
| 15. |
Which of these methods is used to compare two strings such that after comparison output returns different integer values as (0 for false, 1 for true)?(a) Equals ()(b) == operator(c) Compare()(d) None of the mentionedI have been asked this question in an online interview.Asked question is from Comparison of Strings topic in section Arrays and Strings of C# |
|
Answer» The correct option is (c) COMPARE() |
|
| 16. |
Which of these methods of class String is used to compare two String objects for their equality?(a) equals()(b) Equals()(c) isequal()(d) Isequal()This question was addressed to me in final exam.I'd like to ask this question from Comparison of Strings in section Arrays and Strings of C# |
|
Answer» The CORRECT choice is (a) EQUALS() |
|
| 17. |
Which of these operators can be used to concatenate two or more String objects?(a) +(b) +=(c) &(d) ||I got this question in an internship interview.This question is from Basic Operation on Strings in section Arrays and Strings of C# |
|
Answer» RIGHT OPTION is (a) + To explain:STRING s1 = "Hello"+ " I " + "LOVE" + " ComputerScience "; Console.WriteLine(s1); Hello I Love ComputerScience. |
|