0%
67

1 / 20

Category: (Java)

1. In a hospital management system, the Patient class has methods like admit() and discharge(). These methods' signatures are the same in subclasses but have different implementations. What is this an example of?

2 / 20

Category: (Java)

2. What will the following code output?
java
class Test {
public static void main(String[] args) {
String str = "hello";
str.concat(" world");
System.out.println(str);
}
}

3 / 20

Category: (Java)

3. In the Stream API, which of these is not a terminal operation?

4 / 20

Category: (Java)

4. Which method must be implemented when implementing the Runnable interface?

5 / 20

Category: ( C )

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

6 / 20

Category: ( C++ )

6. What is the output of this program?

#include

template

void print(T x) { std::cout << x; } int main() { print(5);

return 0;

}

7 / 20

Category: ( C++ )

7. What is the output of this code?

int a = 5, b = 10;

std::swap(a, b);

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

8 / 20

Category: (Java)

8. In a ticket booking application, multiple users try to book the last available ticket simultaneously. Which Java feature can handle this scenario?

9 / 20

Category: (Java)

9. What is the purpose of the ForkJoinPool class?

10 / 20

Category: ( C++ )

10. What will happen when this code is executed?

#include

class Test {

public:

Test() { std::cout << "Constructor"; } ~Test() { std::cout << "Destructor"; } }; int main() { Test* t = new Test(); return 0; }

11 / 20

Category: ( C++ )

11. What does the keyword explicit do in C++?

12 / 20

Category: ( C )

12. Which of the following functions cannot be used with FILE* in C?

13 / 20

Category: ( C )

13. Which is true about calloc in C?

14 / 20

Category: ( C )

14. What is the output of this program?

#include

int main() {

int a = 5, b = 10;

printf("%d %d", a, b);

return 0;

}

15 / 20

Category: ( C++ )

15. What does the following code snippet indicate?

void foo() noexcept { }

16 / 20

Category: ( C )

16. What is the output of the following ?

#include
void main()
{
int a[5] = { 5, 1, 15, 20, 25 };
int i, j, m;
i = ++a[1];
j = a[1]++;
m = a[i++];
printf("%d, %d, %d", i, j, m);
}

17 / 20

Category: (Java)

17. In a payment gateway system, retrying a failed transaction can cause data corruption if not handled carefully. What technique helps avoid this?

18 / 20

Category: ( C++ )

18. Which header file is required for std::thread?

19 / 20

Category: ( C++ )

19. 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; }

20 / 20

Category: ( C )

20. Which function is used to allocate memory in C?

Scroll to Top