0% 65 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: ( C++ ) 1. What is the purpose of std::forward in C++? A) Always casts to a reference B) Allows dynamic type casting C) Perfect forwarding of arguments in templates D) Ensures thread safety 2 / 20 Category: (Java) 2. In an order management system, a final class Order is used to prevent extension. What is the primary advantage of this? A) Prevents overriding critical logic B) Promotes polymorphism C) Improves inheritance hierarchy D) Ensures immutability 3 / 20 Category: ( C++ ) 3. What happens when you try to delete a null pointer in C++? A) Crashes the program B) Causes undefined behavior C) Throws an exception D) Has no effect 4 / 20 Category: ( C ) 4. What is the return type of the main function in C? A) int B) void C) char D) None of the above 5 / 20 Category: ( C ) 5. 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); } A) 3, 2, 15 B) 2, 1, 15 C) 2, 3, 20 D) 1, 2, 5 6 / 20 Category: ( C ) 6. What will happen if you access memory beyond the array size in C? A) Segmentation fault B) Program crashes gracefully C) Undefined behavior D) Compiler detects the error 7 / 20 Category: (Java) 7. What is the key difference between LinkedList and ArrayList? A) ArrayList uses contiguous memory, while LinkedList uses nodebased memory. B) LinkedList provides faster random access than ArrayList. C) LinkedList is synchronized, but ArrayList is not. D) ArrayList allows duplicate elements, but LinkedList does not. 8 / 20 Category: ( C ) 8. Which of the following statements is incorrect? A) A void pointer can point to any type of data B) sizeof(int*) is equal to sizeof(char*) on the same system C) Arrays can be assigned to pointers D) Pointers store memory addresses 9 / 20 Category: ( C ) 9. Which of the following statements about enum in C is true? A) enum can define symbolic constants B) enum variables store strings C) The values of enum start from 1 by default D) enum cannot be used in switch cases 10 / 20 Category: (Java) 10. Which of these classes is not synchronized? A) StringBuilder B) StringBuffer C) Vector D) HashTable 11 / 20 Category: ( C++ ) 11. What is the use of std::priority_queue? A) To provide fast access to the largest or smallest element B) To provide dynamic array functionality C) To maintain sorted data D) To implement linked lists 12 / 20 Category: ( C++ ) 12. What is the output of this code? int x = 5; int &y = x; y = 10; std::cout << x; A) Compilation error B) 10 C) 5 D) Undefined behavior 13 / 20 Category: ( C++ ) 13. What is the output of the following code? int x = 10, y = 20; int z = x > y ? x : y; std::cout << z; A) 10 B) Undefined behavior C) 20 D) Compilation error 14 / 20 Category: ( C ) 14. what will be the output of the following program? #include int main() { int a = 10; printf("%d", a++ * a++); return (0); } A) No output B) 100 C) 110 D) 105 15 / 20 Category: (Java) 15. Which of these is a marker interface? A) Both A and C B) Serializable C) Comparable D) Cloneable 16 / 20 Category: ( C++ ) 16. What happens if you attempt to access an out-of-bounds element in a std::vector using operator[]? A) Results in undefined behavior B) Compilation error C) Returns the last element D) Throws an exception 17 / 20 Category: (Java) 17. In an ecommerce system, you want to hide sensitive user details like passwords. Which OOP principle helps achieve this? A) Inheritance B) Abstraction C) Polymorphism D) Encapsulation 18 / 20 Category: (Java) 18. 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); } } A) Compilation error B) hello C) hello world D) Runtime error 19 / 20 Category: ( C++ ) 19. What is the output of this code? int a = 10; if (a = 5) { std::cout << "True"; } else { std::cout << "False"; } A) Undefined behavior B) Compilation error C) False D) True 20 / 20 Category: (Java) 20. A school management system has a Person class with Student and Teacher subclasses. Which Java feature allows calling overridden methods at runtime? A) Overloading B) Encapsulation C) Static Binding D) Dynamic Binding Your score is LinkedIn Facebook Twitter VKontakte 0%