Java and C++ Programming Concepts
Test your knowledge of Java and C++ programming concepts including OOP, operators, functions, and language-specific features.
Questions
int *p(char *a)
- p is a function that returns a pointer to an integer quantity
- p is a function that accepts an argument which is a pointer to a character and returns a pointer to an integer quantity
- p is a function that accepts an argument which is a pointer to a character and returns an integer quantity
- None of the above
int (*p(char *a))[10]
- p is a function that accepts an argument which is a pointer to a character and returns a pointer to a 10 element integer array
- p is a function that accepts an argument which is a pointer to a character array and returns an integer quantity
- p is a pointer to a function that accepts an argument which is a pointer to a character and returns an integer quantity
- None of the above
The compiler uses it to internally reference the data members of a particular object
- vtable entry
- this pointer
- Constructors
- default value
Different Return type is sufficient to overload two C++ functions
- True
- False
An operator overloading member function requires no arguments for a unary operator
- True
- False
Which of the operators can be overloaded
- ::
- :?
- [ ]
- .
The precedence of the operators can be changed by operator overloading
- True
- False
Which one does not have a valueOf(String) method ?
- )Integer
- Boolean
- Character
- Long
The initial value of an instance variable of type String which is not explicitly initialized in the program is --.
- null
- ""
- NULL
- 0
What is the output (Assuming written inside main) ? String s1 = new String("gopal"); String s2 = s1.replace('m','i'); s1.concat("Poddar"); System.out.println(s1); System.out.println((s1+s2).charAt(5));
- Compile error
- gopalPoddar o
- gopalPoddar i
- gopal i
Is the statement true"interface contains variables that must be static and final; abstract class may contain non-final and final variables."
- True
- False
- Neither true nor false
- No idea
Which of them is false about a Static data member within a class
- A single copy of the data member exists
- The data member is initialised to zero before the first object is created
- Requires a global definition
- Storage is allocated to the static data member on declaration
An array of references can be created
- True
- False
Is HTML page a web component?
- True
- False
Throwable is the base class for Error and Exception?
- True
- False
"This" keyword in java refer to current object?
- True
- False
is JVM a interpreter?
- True
- False
Final class can be overridden. This statement is…
- True
- False