Java Programming OOP Questions and Answers Set 4

Java Programming OOPs

Questions 31 to 40



31.
Mark the incorrect statement from the following:
(a)   Java is a fully object oriented language with strong support for proper software engineering techniques
(b)   In java it is not easy to write C-like so called procedural programs
(c)   In java language objects have to be manipulated
(d)   In java language error processing is built into the language
(e)   Java is not a language for internet programming.
32.
In java, objects are passed as
(a)  Copy of that object                          (b)  Method called call by value
(c)  Memory address                                                            (d)  Constructor    
(e)  Default constructor.
33.
Which of the following is not a component of Java Integrated Development Environment (IDE)?
(a)  Net Beans                                        (b)  Borland’s Jbuilder
(c)  Symantec’s Visual CafĂ©                    (d)  Microsoft Visual Fox Pro
(e)  Microsoft Visual J++.
34.
Identify, from among the following, the incorrect variable name(s).
(a)  _theButton                                       (b)  $reallyBigNumber
(c)  2ndName                                         (d)  CurrentWeatherStateofplanet
(e)  my2ndFont.

Use the following declaration and initialization to evaluate the Java expressions given in questions 5 - 8;
int a = 2, b = 3, c = 4, d = 5;
float k = 4.3f;
35.
System.out.println( - -b * a + c *d - -);
(a)  21                     (b)  24                     (c)  28                     (d)  26                     (e)  22.
36.
System.out.println(a++);
(a)  3                       (b)  2                       (c)  4                       (d)  10           (e)  Synatax error.
37.
System.out.println (–2U * ( g – k ) +c);
(a)  6                       (b)  3                       (c)  2                       (d)  1              (e)  Syntax error.
38.
System.out.println (c=c++);
(a)  2                       (b)  4                       (c)  5                       (d)  8              (e)  Syntax error.
39.
Consider the following Java program :
class IfStatement{
public static void main(String args[])
       {
       int a=2, b=3;
              if (a==3)
              if (b==3)
              System.out.println("===============");
              else
              System.out.println("#################");
              System.out.println("&&&&&&&&&&&");
       }
}
Which of the following will the output be?
(a)   ===============
(b)   #################
&&&&&&&&&
(c)   &&&&&&&&&&&
(d)   ===============
#################
&&&&&&&&&&
(e)   ################.
40.
An applet cannot be viewed using
(a)   Netscape navigator
(b)   Microsoft Internet Explorer
(c)   Sun’ Hot Java Browser
(d)   Applet viewer tool which comes, with the Java Development Kit.
(e)   Jbuilder.

Use the following Java program for answering question 11 and 12
class test{
 void meth(int i, int j)
     {
       i *= 2;
       i /= 2;
     }
}

class argumentPassing
{
       public static void main(String args[])
              {
              test ob = new test();
              int a = 15, b = 20;

              System.out.println("a and b before call :"+ a +" " + b);
              ob.meth(a,b);
              System.out.println("a and b after call : "+ a + " " +b);
                      }

                               (Program – III)
 





Answers


31.
Answer : (d)
Reason : Java is basically designed for compiler construction but later on it is also being used for internet programming.
32.
Answer : (c)
Reason : Objects are passed as  memory address  but not by the constructor etc.,
33.
Answer : (c)
Reason : Micro soft visual foxpro is not the part of IDE
34.
Answer : (c)
Reason : A variable name should not start with numeric digit,
35.
Answer : (b)
Reason : Based on the hierarchy of operations 24 is correct answer.
36.
Answer : (b)
Reason : Based on the postincrementation operator 2 is the correct answer.
37.
Answer : (e)
Reason : Syntatically the expression is wrong.
38.
Answer : (b)
Reason : first c is assigned by 2 and then incremented
39.
Answer : (c)
Reason : C is the right choice because of the IF statement hierarchy.
40.
Answer : (d)
Reason : Applet cant be viewed using JBuilder.


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



11 comments :

  1. Thanks for your informative post on Java application development. This open source platform assists software developers to create stunning mobile application with ease. Further, they can make use of this platform at free of cost.
    .Net Training in Chennai
    PHP Training in Chennai
    Big Data Training in Chennai

    ReplyDelete
  2. The information you have deliver here is really useful to make my knowledge good. Thanks for your heavenly post. It is truly supportive for us and I have accumulated some essential data from this blog.
    Regards,
    sas training in Chennai|sas course in Chennai|sas training institute in Chennai

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Error in Question no 33, option is c or d ??

    ReplyDelete
  5. Hi Admin,
    Excellent blog and its totally loaded with valid posts on Java and .Net technology. Consider including RSS feed in your blog, so aspirants like me can follow your blog easily. .Net Training in Chennai

    ReplyDelete
  6. 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.
    Regards,

    Python Training in Chennai|Python Classes in Chennai

    ReplyDelete
  7. Hi Admin,
    Quite Interesting post!!! Thanks for posting such a useful post about OOPS. I wish to read your upcoming blog to enhance my skill set in java, keep blogging.
    Regards,
    SAP training in chennai|SAP course in chennai|SAP training

    ReplyDelete
  8. Helo Admin,
    I really enjoyed while reading your article, the information you have mentioned in this post was damn good. Keep sharing your blog with updated and useful information.
    Regards,
    sap training in Chennai|sap course in Chennai|SAP Training in Chennai|SAP FICO Training in Chennai

    ReplyDelete
  9. No. 40 you say the answer is (d) , and you also say that Applet cant be viewed using JBuilder.
    i know that SDK or JDK has the applet viewer tool ..so the answer should be (e)
    Thanks alot

    ReplyDelete
  10. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    salesforce training in chennai | salesforce training institute in chennai

    ReplyDelete
  11. Hibernate Training Institutes in ChennaiHibernate Training Institutes in Chennai Hibernate Online Training Hibernate Online Training Hibernate Training in Chennai Hibernate Training in Chennai Java Online Training Java Online Training

    ReplyDelete