Questions 41: float (*p)[5];
Here, p is ____________________________________
Answer: d) pointer to array of float
Questions 42: What will be the output of the following program?
import java.util.*;
public class Main{
public static void main(String args[])
{
ArrayList < Integer > TempArrayList=new ArrayList< Integer >();
TempArrayList.add(30);
TempArrayList.add(20);
TempArrayList.add(10);
TempArrayList.add(40);
TempArrayList.add(50);
Collections.sort(TempArrayList,Collections.reverseOrder());
Collections.sort(TempArrayList,Collections.reverseOrder());
System.out.println(TempArrayList);
}
}
Type your answer in the box below:
Answer: 50, 40, 30, 20, 10
Questions 43: What is the function rewind()?
Answer: c) Setting file pointer at the beginning of file.
Questions 44: Consider following variables declarations
float num1;
short num2;
Long num3;
What is the datatype of num1 - num3 / num2 ?
Answer: c) float
Questions 45: What will be the output of the following program:
abstract class Shape
{
public abstract void Disp();
}
class Triangle extends Shape
{
public final void Disp(){
System.out.println("Triangle");
}
}
class Rectangle extends Triangle
{
public void Disp(){
System.out.println("Its Rectangle");
}
}
public class Main{
public static void main(String args[])
{
Rectangle obj=new Rectangle();
obj.Disp();
}
}
Answer: b)Compile Time error
Questions 46: Construct Post order Traversal for the constructed Tree with the given In- Order and Pre- Order Traversals:
In - Order : 9 7 10 6 8
Pre - Order : 6 7 9 10 8
Answer: a) 9 10 7 8 6
Questions 47: The kind of software testing you can do when you have both the source code and the executable code in hand?
Answer: c) Red Box Testing
Questions 48: Select the precise options for the below scenarios
Expression 1: cout << endl;
Expression 2: cout<<'\n'<< flush;
Answer: NA
Questions 49: Spot the error in the given code. If there is no error, select the most appropriate option
class Employee
{
private :
int UserId;
public :
Employee(): UserId(0){} // ------------- line 8
friend int displayUser( Employee);
};
int displayUser(Employee emp)
{
emp.UserId + =12;
return emp.UserId; // ------------- line 14
}
int main()
{
Employee e;
count << "Employee UserId: " << displayUser(e) << endl; // ------------- line 19
return 0;
}
Answer: NA
Questions 50: What will be the output of the below program:
public class Main
{
public static void main(String args[])
{
int x=10, y, z;
z = y = x ;
y - = x --;
z - = -- x;
x - = --x - x-- ;
System.out.println(x+"-"+y+"-"+z);
}
}
Answer: 8-0-2