GAT Subject :: All Aptitude Test ::

Hassan
1.Which among the following is wrong ?
A. class student{ }; student s;
B. abstract class student{ }; student s;
C. abstract class student{ }s[50000000];
D. class student{ }; student s;

2.Object declared in main() function ?
A. Can be used by any other function
B. Can be used by main() function of any other program
C. Can’t be used by any other function
D. Can be used by any other function

3. When an object is returned ?
A. A temporary object is created to return the value
B. The same object used in function is used to return the value
C. The Object can be returned without creation of temporary object
D. A temporary object is created to return the value

4.Which among the following is correct ?
A. class student{ }s1,s2; s1.student()=s2.student();
B. class student{ }s1; class topper{ }t1; s1=t1;
C. class student{ }s1,s2; s1=s2;
D. class student{ }s1,s2; s1.student()=s2.student();

5.Which among following is correct for initializing the class below ?
A. student s[3]={ s(394, 9); s(394, 9); s(394,9); };
B. student s[2]={ s(394,9), s(222,5) };
C. student s[2]={ s1(392,9), s2(222,5) };
D. student s[3]={ s(394, 9); s(394, 9); s(394,9); };

6.Which among the following doesn’t come under OOP concept ?
A. Platform independent
B. Data binding
C. Message passing
D. Platform independent

7.Which feature of OOP is indicated by the following code ?
A. Inheritance
B. Polymorphism
C. Inheritance and polymorphism
D. Inheritance

8.Which feature may be violated if we don’t use classes in a program ?
A. Inheritance can’t be implemented
B. Object must be used is violated
C. Encapsulation only is violated
D. Inheritance can’t be implemented

9.How many basic features of OOP are required for a programming language to be purely OOP ?
A. 7 features
B. 6 features
C. 5 features
D. 7 features

10.The feature by which one object can interact with another object is ?
A. Data transfer
B. Data Binding
C. Message Passing
D. Data transfer

11.Which underlines the feature of Polymorphism in a class ?
A. Nested class
B. Enclosing class
C. Inline function
D. Nested class

12.Which feature in OOP is used to allocate additional function to a predefined operator in any language ?
A. Operator Overloading
B. Function Overloading
C. Operator Overriding
D. Operator Overloading

13.Which among doesn’t illustrates polymorphism ?
A. Function overloading
B. Function overriding
C. Operator overloading
D. Function overloading

14.Which among the following, for a pure OOP language, is true ?
A. The language should follow 3 or more features of OOP
B. The language should follow at least 1 feature of OOP
C. The language must follow only 3 features of OOP
D. The language should follow 3 or more features of OOP

15.Does OOP provide better security than POP ?
A. Always true for any programming language
B. May not be true with respect to all programming languages
C. It depends on type of program
D. Always true for any programming language

16.Which of the following statement is a proposition ?
A. Get me a glass of milkshake
B. God bless you!
C. What is the time now?
D. Get me a glass of milkshake

17.Which of the following option is true ?
A. If the Sun is a planet, elephants will fly
B. 3 +2 = 8 if 5-2 = 7
C. 1 > 3 and 3 is a positive integer
D. If the Sun is a planet, elephants will fly

18.What is the value of x after this statement, assuming initial value of x is 5 ?
A. 1
B. 3
C. 0
D. 1

19. Let P: I am in Bangalore. , Q: I love cricket. ; then q -> p(q implies p) is ?
A. If I love cricket then I am in Bangalore
B. If I am in Bangalore then I love cricket
C. I am not in Bangalore
D. If I love cricket then I am in Bangalore

20.Let P:If Ali bowls, Ahmad hits a century. , Q: If Hassan bowls , Ali gets out on first ball.
A. Hassan bowled and Ali got out on first ball
B. Hassan did not bowled
C. Ali bowled and Ahmad hits a century
D. Hassan bowled and Ali got out on first ball

21.Let P: I am in Islamabad. , Q: Islamabad is clean. ; then q ^ p(q and p) is ?
A. Islamabad is clean and I am in Islamabad
B. Islamabad is not clean or I am in Islamabad
C. I am in Islamabad and Islamabad is not clean
D. Islamabad is clean and I am in Islamabad

22.Let P: This is a great website, Q: You should not come back here ?
A. ~P V ~Q
B. P ∧ ~Q
C. P V Q
D. ~P V ~Q

23.Let P: We should be honest., Q: We should be dedicated .,R: We should be overconfident ?
A. ~P V ~Q V R
B. P ∧ ~Q ∧ R
C. P V Q ∧ R
D. ~P V ~Q V R

24.How do you instantiate an array in Java ?
A. int arr[] = new int(3);
B. int arr[];
C. int arr[] = new int[3];
D. int arr[] = new int(3);

25.Which of the following is a correct way to declare a multidimensional array in Java ?
A. int[] arr;
B. int arr[[]];
C. int[][]arr;
D. int[] arr;

26.What is the output of the following piece of code ?
A. 3 and 5
B. 5 and 3
C. 2 and 4
D. 3 and 5

27.What is the output of the following piece of code ?
A. 4
B. 5
C. ArrayIndexOutOfBoundsException
D. 4

28.When does the ArrayIndexOutOfBoundsException occur?
A. Compile-time
B. Run-time
C. Not an error
D. Compile-time

29.Which of the following concepts make extensive use of arrays ?
A. Binary trees
B. Scheduling of processes
C. Caching
D. Binary trees

30.What are the advantages of arrays ?
A. Objects of mixed data types can be stored
B. Elements in an array cannot be sorted
C. Index of first element of an array is 1
D. Objects of mixed data types can be stored


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers