0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: (Java) 1. A school management system has a Person class with Student and Teacher subclasses. Which Java feature allows calling overridden methods at runtime? A) Encapsulation B) Dynamic Binding C) Static Binding D) Overloading 2 / 20 Category: ( C++ ) 2. What is the result of this code? #include int main() { int x = 10, y = 20; std::swap(x, y); std::cout << x << " " << y; return 0; } A) Undefined behavior B) 20 10 C) 10 20 D) Compilation error 3 / 20 Category: ( C++ ) 3. What does std::future provide in C++? A) Real-time threading B) Memory management C) Exception handling D) A mechanism to retrieve the result of an asynchronous operation 4 / 20 Category: (Java) 4. What is the purpose of the ForkJoinPool class? A) Manage thread lifecycles in GUIbased programs. B) Provides an alternative to ThreadPoolExecutor. C) Optimizes performance by limiting thread creation. D) Divide a task into smaller subtasks and execute them concurrently. 5 / 20 Category: (Java) 5. In a concurrent program, which ExecutorService method will block until all submitted tasks are complete? A) submit() B) invokeAll() C) execute() D) shutdownNow() 6 / 20 Category: (Java) 6. Which of the following is not a valid reason to use an interface in Java? A) To achieve abstraction B) To hide implementation details C) To define multiple inheritance D) To create default methods 7 / 20 Category: ( C ) 7. Which of the following is NOT a valid preprocessor directive? A) #define B) #endif C) #while D) #ifdef 8 / 20 Category: ( C++ ) 8. What happens when you try to delete a null pointer in C++? A) Crashes the program B) Causes undefined behavior C) Has no effect D) Throws an exception 9 / 20 Category: ( C++ ) 9. 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; } A) Compilation error B) Prints "ConstructorDestructor" C) Only prints "Constructor" D) Only prints "Destructor" 10 / 20 Category: ( C ) 10. What will happen with this code? #include int main() { int a = 5 / 0; printf("%d", a); return 0; } A) Compilation error B) Undefined behavior C) Runtime error D) Prints 0 11 / 20 Category: (Java) 11. What will the following program print? java class Test { public static void main(String[] args) { int x = 10; System.out.println(x++ + ++x); } } A) 22 B) Compilation error C) 23 D) 21 12 / 20 Category: ( C ) 12. What is the output of the following code? #include int main() { int a = 5; int *p = &a; *p = 10; printf("%d", a); return 0; } A) 10 B) Compilation error C) Garbage value D) 5. 13 / 20 Category: (Java) 13. In an ecommerce system, you want to hide sensitive user details like passwords. Which OOP principle helps achieve this? A) Polymorphism B) Abstraction C) Inheritance D) Encapsulation 14 / 20 Category: ( C++ ) 14. What does the following code snippet indicate? void foo() noexcept { } A) The function is thread-safe B) The function can throw exceptions C) The function does not throw exceptions D) The function has no arguments 15 / 20 Category: ( C++ ) 15. What is the output of this code? #include int main() { int arr[] = {10, 20, 30}; int *ptr = arr; ptr++; std::cout << *ptr; return 0; } A) 30 B) 20 C) Undefined behavior D) 10 16 / 20 Category: ( C++ ) 16. What is the output of this code? #include void display(int x = 10) { std::cout << x; } int main() { display(); return 0; } A) Undefined behavior B) 0 C) 10 D) Compilation error 17 / 20 Category: ( C ) 17. What will happen with the following code? #include int main() { char str[5] = "hello"; printf("%s", str); return 0; } A) hell B) hello C) Compilation error D) Undefined behavior 18 / 20 Category: (Java) 18. In an inventory system, you want to restrict access to methods that update product quantities to only admin users. How can you achieve this in Java? A) Use synchronized methods B) Use private methods C) Use final keyword D) Implement access control logic with encapsulation 19 / 20 Category: ( C ) 19. What does the following code print? #include int main() { int x = 10; int y = 5; printf("%d", x++ + ++y); return 0; } A) 15 B) 16 C) Compilation error D) 17 20 / 20 Category: ( C ) 20. What is the purpose of the volatile keyword in C? A) To declare variables that cannot be modified B) To declare a constant variable C) To prevent compiler optimizations on a variable D) To allocate memory dynamically Your score is LinkedIn Facebook Twitter VKontakte 0%