
Practice OOPS Concepts –
What will be the output of the program?
public class Test {
public static void main (String[] args) {
String foo = args[1];
String bar = args[2];
String baz = args[3];
System.out.println("baz = " + baz); /* Line 8 */
}
}
And the command line invocation :-
java Test red green blue
What would be the output of the following program ?

Practice OOPS Concepts –
What would be the output of the following program ?
class test {
public static void main(String[] args) {
for(int i=0;i<=args.length;i++);
System.out.println(args[i]);
}
}
What will be the output of the following program?

Practice OOPS Concepts –
What will be the output of the following program?
#include
class Number {
int Num;
public:
Number(int x = 0) {
Num = x;
}
void Display(void) {
cout<< Num;
}
void Modify();
};
void Number::Modify() {
int Dec;
Dec = Num % 13;
Num = Num / 13;
if(Num > 0 ) {
Modify();
}
if(Dec == 10) {
cout<< "A" ;
}
else if(Dec == 11){
cout<< "B" ;
}
else if(Dec == 12) {
cout<< "C" ;
}
else if(Dec == 13) {
cout<< "D" ;
}
else {
cout<< Dec ;
}
}
int main() {
Number objNum(130);
objNum.Modify();
return 0;
}
What will be the output of the following program?

Practice OOPS Concepts –
What will be the output of the following program?
#include
class Crackexams {
int x, y, z;
public:
void Apply(int xx = 12, int yy = 21, int zz = 9) {
x = xx;
y = yy += 10;
z = x -= 2;
}
void Display(void) {
cout<< x << " " << y << endl;
}
void SetValue(int xx, int yy) {
Apply(xx, 0, yy);
}
};
int main() {
Crackexams *pCrackexams= new Crackexams;
(*pCrackexams).SetValue(12, 20);
pCrackexams->Display();
delete pCrackexams;
return 0;
}
Which of the following statement is correct about the program given

Practice OOPS Concepts –
Which of the following statement is correct about the program given below?
#include
class Crackexams {
int x, y, z;
public:
Crackexams(int x = 100, int y = 30, int z = 0) {
this->x = x;
this->y = y;
this->z = z;
Display();
}
void Display() {
cout<< x << " " << y << " " << z;
}
};
int main() {
int a = 0, b = 1, c = 2;
int &x = ++a;
int &y = --b;
int z = c + b - -c;
Crackexams objCrackexams(x, y, z);
return 0;
}
What will be the output of the following program?

Practice OOPS Concepts –
What will be the output of the following program?
#include
void MyFunction(int a, int b = 40) {
cout<< " a = "<< a << " b = " << b << endl;
}
int main() {
MyFunction(20, 30);
return 0;
}
What will be the output of the following program?

Practice OOPS Concepts –
What will be the output of the following program?
#include
static int b = 0;
void DisplayData(int *x, int *y = &b) {
cout<< *x << " " << *y;
}
int main() {
int a = 10, b = 20 ;
DisplayData(&a, &b);
return 0;
}
What will be the output of the following program?

Practice OOPS Concepts –
What will be the output of the following program?
#include
void Tester(int xx, int yy = 5);
class Crackexams {
int x;
int y;
public:
void Tester(int xx, int yy = 5){
x = xx;
y = yy;
cout<< ++x % --y;
}
};
int main() {
Crackexams obj;
obj.Tester(5, 5);
return 0;
}
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;
}
- Emp e(); e = new Emp();
- Emp e = new Emp;
- Emp e; e = new Emp;
- Emp e = new Emp();
- Emp e;
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();
Which of the following statements is correct?

Practice OOPS Concepts –
Which of the following statements is correct?
- Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
- A reference is not a constant pointer.
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;
}
- Emp e(); e = new Emp();
- Emp e = new Emp;
- Emp e; e = new Emp;
- Emp e = new Emp();
- Emp e;
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();