Java Programming OOP Questions and Answers Set 5

Java Programming OOPs

Questions 41 to 50



41.
What would the output be of the above Program - III before and after it is called?
(a)   and b before call : 15  20                a and b after call : 30  10
(b)   a and b before call : 5   2                a and b after call : 15  20
(c)   a and b before call : 15  20 a and b after call : 15  20
(d)   a and b before call : 30  10 a and b after call : 15  20
(e)   a and b before call : 15  20 a and b after call :
42.
What would the argument passing method be which is used by the above Program - III?
(a)  Call by value                                    (b)  Call by reference
(c)  Call by java.lang class                      (d)  Call by byte code                           
(e)  Call by compiler.
43.
Consider the following program:
class prob1{
int puzzel(int n){

       int result;

       if (n==1)
          return 1;
       result = puzzel(n-1) * n;
         return result;
 }
}

class prob2{

public static void main(String args[])

  {

      prob1 f = new prob1();

      System.out.println(" puzzel of 6 is = " + f.puzzel(6));

   }
}
Which of the following will be the output of the above program?
(a)  6                       (b)  120                   (c)  30                     (d)  720                   (e)  12.
44.
The blank space in the following sentence has to be correctly filled :
Members of a class specified as ……………….. are accessible only to methods of that class.
(a)  Protected          (b)  Final                 (c)  Public               (d)  Private              (e)  Static.
45.
Java compiler javac translates Java source code into ………………………
(a)  Assembler language                         (b)  Byte code
(c)  Bit code                                          (d)  Machine code   
(e)  Platform dependent code.
46.
……………….. are used to document a program and improve its readability.
(a)  System cells      (b)  Keywords          (c)  Comments         (d)  Control structures         (e)  Blocks.
47.
In Java, a character constant’s value is its integer value in the ………………………character set.
(a)  EBCDIC            (b)  Unicode            (c)  ASCII                (d)  Binary               (e)  BCD.
48.
In Java, a try block should immediately be followed by one or more ……………….. blocks.
(a)  Throw       (b)  Run   (c)  Exit (d)  Catch          (e)  Error.
49.
An abstract data type typically comprises a …………… and a set of ……………... respectively.
(a)  Data representation, classes             (b)  Database, operations
(c)  Data representation, objects             (d)  Control structure, operations
(e)  Data representation, operations.
50.
In object-oriented programming, the process by which one object acquires the properties of another object is called
(a)  Encapsulation                                  (b)  Polymorphism   (c)  Overloading
(d)  Inheritance                                       (e)  Overriding.






Answers



41.
Answer : (c)
Reason : There wont be any change because of the scope.
42.
Answer : (a)
Reason : Call by value is the right choice.
43.
Answer : (d)
Reason : 720 is the output after the execution of the program
44.
Answer : (d)
Reason : Private access specifier property says that members of class of private are accessible only to the methods of that class.
45.
Answer : (b)
Reason : Byte Code is the file which is generated after java source file is compiled.
46.
Answer : (c)
Reason : Comments improve the readability of the program
47.
Answer : (b)
Reason : Java uses Unicode format.
48.
Answer : (d)
Reason : Try must be followed by catch block in exceptions in java.
49.
Answer : (e)
Reason : An abstract data type contains data representation and operations
50.
Answer : (d)
Reason : Inheritance is the mechanism in which one object acquires the properties of another object.



<< Prev   1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20   21   22  

 23   24   25   26   27   28   29   30  Next >>


12 comments :

  1. I almost gave correct answer with my knowledge in java, thanks for sharing.
    Regards,

    JAVA Training in Chennai|JAVA Course in Chennai

    ReplyDelete

  2. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android training in chennai

    ReplyDelete
  3. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Ios training in chennai

    ReplyDelete
  4. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Ios training in chennai

    ReplyDelete

  5. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.
    Android App Development Company

    ReplyDelete
  6. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    web design Company
    web development Company
    web design Company in chennai
    web development Company in chennai
    web design Company in India
    web development Company in India

    ReplyDelete
  7. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
    iOS App Development Company
    iOS App Development Company

    ReplyDelete
  8. Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.. i am expecting more updated posts from your hands.
    Fitness SMS
    Salon SMS
    Investor Relation SMS

    ReplyDelete
  9. it is really amazing...thanks for sharing....provide more useful information...
    Mobile app development company

    ReplyDelete