JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 47
Object Oriented Programming interview questions part 47
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which keyword should be used to declare the static member functions?
A. static
B. stat
C. const
D. common
Show Correct Answer
Correct Answer is :
static
2. The keyword static is used _______________
A. With declaration inside class and with definition outside the class
B. With declaration inside class and not with definition outside the class
C. With declaration and definition wherever done
D. With each call to the member function
Show Correct Answer
Correct Answer is :
With declaration inside class and not with definition outside the class
3. The keyword static is used _______________
A. With declaration inside class and with definition outside the class
B. With declaration inside class and not with definition outside the class
C. With declaration and definition wherever done
D. With each call to the member function
Show Correct Answer
Correct Answer is :
With declaration inside class and not with definition outside the class
4. Which among the following can’t be used to access the members in any way?
A. Scope resolution
B. Arrow operator
C. Single colon
D. Dot operator
Show Correct Answer
Correct Answer is :
Single colon
5. Which among the following can’t be used to access the members in any way?
A. Scope resolution
B. Arrow operator
C. Single colon
D. Dot operator
Show Correct Answer
Correct Answer is :
Single colon
6. We can use the static member functions and static data member __________________
A. Even if class object is not created
B. Even if class is not defined
C. Even if class doesn’t contain any static member
D. Even if class doesn’t have complete definition
Show Correct Answer
Correct Answer is :
Even if class object is not created
7. We can use the static member functions and static data member __________________
A. Even if class object is not created
B. Even if class is not defined
C. Even if class doesn’t contain any static member
D. Even if class doesn’t have complete definition
Show Correct Answer
Correct Answer is :
Even if class object is not created
8. The static data member _________________
A. Can be mutable
B. Can’t be mutable
C. Can’t be integer
D. Can’t be characters
Show Correct Answer
Correct Answer is :
Can’t be mutable
9. The static data member _________________
A. Can be mutable
B. Can’t be mutable
C. Can’t be integer
D. Can’t be characters
Show Correct Answer
Correct Answer is :
Can’t be mutable
10. If static data member are made inline, ______________
A. Those should be initialized outside the class
B. Those can’t be initialized with the class
C. Those can be initialized within the class
D. Those can’t be used by class members
Show Correct Answer
Correct Answer is :
Those can be initialized within the class
11. If static data member are made inline, ______________
A. Those should be initialized outside the class
B. Those can’t be initialized with the class
C. Those can be initialized within the class
D. Those can’t be used by class members
Show Correct Answer
Correct Answer is :
Those can be initialized within the class
12. Which is a true statement for object of String class?
A. Object are immutable
B. Object are mutable
C. Object are created only once
D. Object can’t be created
Show Correct Answer
Correct Answer is :
Object are immutable
13. How to declare an object of class String?
A. String object_Name = value;
B. String object_name = new;
C. String object_name= new value;
D. String object_name= value new;
Show Correct Answer
Correct Answer is :
String object_Name = value;
14. What does function length do in String class?
A. Returns length of string including null character
B. Returns length of string excluding null character
C. Returns length of substring
D. Returns size of string in bytes
Show Correct Answer
Correct Answer is :
Returns length of string excluding null character
15. Which is the function to get the character present at a particular index in the string?
A. char charAt(index);
B. char charIn(StringName);
C. char charAt(StringName);
D. char charIn(index);
Show Correct Answer
Correct Answer is :
char charAt(index);
16. If only one parameter is passed to substring function then __________________
A. It returns the character at the specified position
B. It returns the string of length 1 from the specified index
C. It returns the string from specified index till the end
D. It returns the string from starting of string till the specified index
Show Correct Answer
Correct Answer is :
It returns the string from specified index till the end
17. If two index are given as argument to substring function then ___________________
A. String of length equal to sum of two arguments is returned
B. String starting from first index and of length equal to send argument
C. String starting from first index and of length equal to sum of two arguments
D. String starting from first index and ending at second index position
Show Correct Answer
Correct Answer is :
String starting from first index and ending at second index position
18. String class have a concat() function that is used to _____________________
A. Replace old string by new string
B. Add two strings
C. Append one string at end of another string
D. Remove a string from end of one string
Show Correct Answer
Correct Answer is :
Append one string at end of another string
19. The function lastIndexOf() is used to ___________________
A. Get the index of last occurrence of specified character in argument
B. Get the index of first occurrence of specified character in argument
C. Get the index of last occurrence of first character in string
D. Get the index of last occurrence of last character of string
Show Correct Answer
Correct Answer is :
Get the index of last occurrence of specified character in argument
20. Function equals() is _______________ and equalIgnoreCase() is _________________
A. Case Insensitive, case insensitive
B. Case sensitive, Case insensitive
C. Case sensitive, case sensitive
D. Case insensitive, case sensitive
Show Correct Answer
Correct Answer is :
Case sensitive, Case insensitive
Similar Interview Questions
Search for latest jobs
Find Jobs