Computer Science :: All Aptitude Test ::

1.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

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

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

4.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

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

6.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

7.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

8.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

9.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

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

11. 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

12.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

13.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

14.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

15.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

16.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);

17.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;

18.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

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

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

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

22.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

23.What are the disadvantages of arrays ?
A. Data structure like queue or stack cannot be implemented
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
C. Index value of an array can be negative
D. Data structure like queue or stack cannot be implemented

24.Assuming int is of 4 bytes, what is the size of int arr[15]; ?
A. 15
B. 19
C. 11
D. 15

25.In general, the index of the first element in an array is ?
A. 0
B. -1
C. 2
D. 0

26.Elements in an array are accessed ?
A. Randomly
B. Sequentially
C. Exponentially
D. Randomly

27.In a stack, if a user tries to remove an element from empty stack it is called ?
A. Underflow
B. Empty collection
C. Overflow
D. Underflow

28.Pushing an element into stack already having five elements and stack size of 5, then stack becomes ?
A. Overflow
B. Crash
C. Underflow
D. Overflow

29.Entries in a stack are “ordered”. What is the meaning of this statement ?
A. A collection of stacks is sortable
B. Stack entries may be compared with the ‘<‘ operation
C. The entries are stored in a linked list
D. A collection of stacks is sortable

30.Which of the following applications may use a stack ?
A. A parentheses balancing program
B. Tracking of local variables at run time
C. Compiler Syntax Analyzer
D. A parentheses balancing program


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