0%
67

1 / 20

Category: (Java)

1. What will the following program print?
java
class Test {
public static void main(String[] args) {
int x = 10;
System.out.println(x++ + ++x);
}
}

2 / 20

Category: ( C++ )

2. What will be the result of the following program?

#include

int main() {

int arr[] = {1, 2, 3, 4, 5};

std::cout << arr[2]; return 0; }

3 / 20

Category: (Java)

3. Which of the following best represents "hasa" relationships in Java?

4 / 20

Category: ( C++ )

4. Which type of memory is managed by std::allocator?

5 / 20

Category: ( C )

5. What is the output of the following code?

#include

int main() {

int a = 5;

int *p = &a;

*p = 10;

printf("%d", a);

return 0;

}

6 / 20

Category: ( C++ )

6. What will happen when this code runs?

#include

class A {

public:

A() { std::cout << "Constructor"; } ~A() { std::cout << "Destructor"; } }; int main() { A obj; return 0; }

7 / 20

Category: (Java)

7. A company requires an interface Employee with a calculateSalary() method for different roles like Manager and Engineer. Which concept is used here?

8 / 20

Category: (Java)

8. What does the following code print?
java
class Test {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder("Hello");
sb.insert(0, "Java");
System.out.println(sb);
}
}

9 / 20

Category: ( C++ )

9. What does mutable keyword do?

10 / 20

Category: (Java)

10. What happens when Thread.sleep(0) is called?

11 / 20

Category: ( C )

11. Which function is used to convert a string to an integer in C?

12 / 20

Category: ( C )

12. What is the size of a pointer in a 64-bit system?

13 / 20

Category: ( C )

13. Which of the following statements about enum in C is true?

14 / 20

Category: ( C )

14. What is the output of this program?

#include

int main() {

int arr[3] = {10, 20, 30};

printf("%d", *(arr + 1));

return 0;

}

15 / 20

Category: ( C++ )

15. Which of the following algorithms is NOT part of STL?

16 / 20

Category: ( C++ )

16. What is the output of this program?

#include

void print(int x) { std::cout << x; } void print(float x) { std::cout << x; } int main() { print(3.5); return 0; }

17 / 20

Category: ( C++ )

17. What is the output of this code?

int a = 5, b = 10;

std::swap(a, b);

std::cout << a << " " << b;

18 / 20

Category: (Java)

18. Which of the following statements about HashMap is true?

19 / 20

Category: ( C )

19. What is the output of the following code?

#include

int main() {

int x = 5;

printf("%d", x = x == 5);

return 0;

}

20 / 20

Category: (Java)

20. What is the output of the following code?
java
class Test {
public static void main(String[] args) {
int[][] arr = {{1, 2}, {3, 4}};
System.out.println(arr[1][1]);
}
}

Scroll to Top