Practice OOPS Concepts –
What is the output of the following code
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];
Practice OOPS Concepts –
What is the output of the following code
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];
Which of the following correctly represents a long double
Practice OOPS Concepts –
Which of the following correctly represents a long double constant?
Which of the following operations are INCORRECT?
Practice OOPS Concepts –
Which of the following operations are INCORRECT?
Which of the declaration is correct?
Practice OOPS Concepts –
Which of the declaration is correct?
What will be the result of the expression 13 25 ?
Practice OOPS Concepts –
What will be the result of the expression 13 & 25 ?
Data members which are static
Practice OOPS Concepts –
Data members which are static
Practice OOPS Concepts –
What is the output of following program?
#include <iostream>
using namespace std;
class A
{
private:
int x;
public:
A(int _x) { x = _x; }
int get() { return x; }
};
class B
{
static A a;
public:
static int get()
{ return a.get(); }
};
int main(void)
{
B b;
cout << b.get();
return 0;
}
Which of the following is true in Java?
Practice OOPS Concepts –
Which of the following is true in Java?
Practice OOPS Concepts –
What is the output of following program?
#include <iostream>
using namespace std;
class Player
{
private:
int id;
static int next_id;
public:
int getID() { return id; }
Player() { id = next_id++; }
};
int Player::next_id = 1;
int main()
{
Player p1;
Player p2;
Player p3;
cout << p1.getID() << " ";
cout << p2.getID() << " ";
cout << p3.getID();
return 0;
}
RunTime Polymorphism is achieved by ___________.
Practice OOPS Concepts –
RunTime Polymorphism is achieved by ___________.
Practice OOPS Concepts –
What is the output of the following code
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];
When would a structure variable get destroyed?
Practice OOPS Concepts –
When would a structure variable get destroyed?
How many bytes will the structure variable samp occupy in
Practice OOPS Concepts –
How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
class Trial {
int i;
Decimal d;
}
struct Sample {
private int x;
private Single y;
private Trial z;
}
Sample samp = new Sample();
Which of the following is the correct way to define a variable of t
Practice OOPS Concepts –
Which of the following is the correct way to define a variable of the type struct Emp declared below?
struct Emp {
private String name;
private int age;
private Single sal;
}
Which of the following is the correct way of setting values into th
Practice OOPS Concepts –
Which of the following is the correct way of setting values into the structure variable e defined below?
struct Emp {
public String name;
public int age;
public Single sal;
}
Emp e = new Emp();