Tuesday, 29 March 2016

UGC-NET COMPUTER SCIENCE DECEMBER 2004 Answer Key with Explanation

Q::11.       Suppose x and y are two Integer Variables having values 0x5AB6 and 0x61CD respectively. The         result  (in hex) of applying bitwise operator AND to x and y will be:

    (A) 0x5089        (B) 0x4084


    (C) 0x78A4       (D) 0x3AD1



Answer: B

Explanation:

                 0x5AB6 = 0101 1010 1011 0110
                 0x61CD = 0110 0001 1100 1101
                 ----------------------------------------------
                 AND     =  0100 0000 1000 0100
                            =  0x4084




Q::12.   Consider the following statements,

   int i=4, j=3, k=0;
   k=++i - --j + i++ - --j +j++; What will be the values of i, j and k after the statement.
   (A) 7, 2, 8           (B) 5, 2, 10


   (C) 6, 2, 8           (D) 4, 2, 8

Answer: C

Explanation:


   The expression will be evaluated as k=5 - 2 + 5 - 1 + 1 => k=8.
                 i=6 and j=2.



Q::13.     What is the value of the arithmetic expression (Written in C)
   2*3/4-3/4* 2
   (A) 0                           (B) 1


   (C) 1.5                        (D) None of the above

Answer: B

Explanation:
          The expression will be evaluated as
           =>2*3/4-3/4* 2
           =>6/4-3/4* 2
           =>1-3/4* 2
           =>1-0*2
           =>1-0
           =>1.

Q::14  A function object:

(A) is an instance of a class for which operator () is a member function.
(B) is an instance of a class for which operator → is a member function.
(C) is a pointer to any function

         (D) is a member function of a class

Answer: A

Explanation:

A function object, or functor, is any type that implements operator(). This operator is referred to as the call operator or sometimes the application operator. The Standard Template Library uses function objects primarily as sorting criteria for containers and in algorithms.

Function objects provide two main advantages over a straight function call. The first is that a function object can contain state. The second is that a function object is a type and therefore can be used as a template parameter.

To create a function object, create a type and implement operator(), such as:
   
 class Functor
    {
              public:
                 int operator()(int a, int b)
                 {
                       return a < b;
                 }
         };

         int main()
         {
              Functor f;
              int a = 5;
              int b = 7;
              int ans = f(a, b);
         }





The last line of the main function shows how you call the function object. This call looks like a call to a function, but it is actually calling operator() of the Functor type. This similarity between calling a function object and a function is how the term function object came about.




Q::15. Polymorphism means:

(A) A template function

(B) Runtime type identification within a class hierarchy

(C) Another name for operator overloading

(D) Virtual inheritance

Answer: B

Explanation:



In programming languages and type theory, Polymorphism (from Greek πολύς, polys, "many, much" and μορφή, morphē, "form, shape") is the provision of a single interface to entities of different types. A polymorphic type is one whose operations can also be applied to values of some other type, or types. There are several fundamentally different kinds of Polymorphism:


Ad hoc polymorphism: When a function denotes different and potentially heterogeneous implementations depending on a limited range of individually specified types and combinations. Ad hoc polymorphism is supported in many languages using function overloading.


Parametric polymorphism: When code is written without mention of any specific type and thus can be used transparently with any number of new types. In the object-oriented programming community, this is often known as generics or generic programming. In the functional programming community, this is often shortened to polymorphism.


Subtyping (also called subtype polymorphism or inclusion polymorphism): When a name denotes instances of many different classes related by some common superclass. In the object-oriented programming community, this is often simply referred to as polymorphism.


The interaction between parametric polymorphism and subtyping leads to the concepts of variance and bounded quantification.

Page 1 2 3 4 5 6 7 8 9 10

ugc net computer science question papers,ugc net computer science december 2014 question papers,
ugc net computer science june 2014 question papers,
ugc net computer science december 2014 question papers,
ugc net computer science june 2013 question papers,
ugc net computer science december 2013 question papers,
ugc net computer science june 2012 question papers,
ugc net computer science december 2012 question papers,
ugc net computer science june 2011 question papers,
ugc net computer science december 2011 question papers,
ugc net computer science june 2010 question papers,
ugc net computer science december 2010 question papers,
ugc net computer science june 2009 question papers,
ugc net computer science december 2009 question papers,
ugc net computer science june 2008 question papers,

ugc net computer science december 2008 question papers,

december 2004 ugc net computer science paper,ugc net computer science december 2004 solution, cbse net all solved papers, cbse net june 2015 paper 2 solution computer science, 

1 comment:

  1. U r amazing. The first time I see solved questions with such good explanation. I'm sure you do amazing things. So generous

    ReplyDelete