Java Programming OOP Questions and Answers Set 6

Java Programming OOPs

Questions 51 to 60



51.
Re-implementing an inherited method in a sub class to perform a different task from the parent class is called
(a)  Binding             (b)  Transferring       (c)  Hiding               (d)  Coupling           (e)  extending.
52.
In a class definition, the special method provided to be called to create an instance of that class is known as a/an
(a)  Interpreter          (b)  Destructor         (c)  Constructor       (d)  Object              (e)  Compiler.
53.
Consider the following statements about Java packages:
I.     Packages don’t provide a mechanism to partition all class names into more manageable chunks.
II.     Packages provide a visibility control mechanism.
III.    One of the important properties of a package is that all classes defined inside a package is accessible by code outside that package.
IV.   The .class files for classes declared to be part of a package can be stored in multiple directories.
Which of them is correct?
(a)  Only (I) above                                  (b)  Only (II) above
(c)  Only (III) above                                 (d)  Only (IV) above
(e)  All (I), (II), (III) and (IV) above are wrong.
54.
Consider the following statements:
I.     A class can be declared as both abstract and final.
II.     A class declared as final can be extended by defining a sub-class.
III.    Resolving calls to methods dynamically at run-time is called late binding.
IV.   The class Object defined by Java need not be a super class of all other classes.
Identify the correct statement from the following:
(a)  Both (I) and (II) above                       (b)  Both (III) and (IV) above
(c)  Both (I) and (III) above                      (d)  Both (II) and (IV) above
(e)  Only (III) above.
55.
Identify, from among the following, the incorrect descriptions related to Java :
(a)   Java Virtual Machine translates byte code into its own system’s machine language and runs the resulting machine code
(b)   The arithmetic operations *, /, %, + and – have the same level of precedence
(c)   Comments do not cause any action to be performed during the program execution
(d)   All variables must be given a type when they are declared
(e)   Java variable names are case-sensitive.
56.
Consider the following statement(s) about Java:
I.     All white-space characters (blanks) are ignored by the compiler.
II.     Java keywords can be used as variable names.
III.    An identifier does not begin with a digit and does not contain any spaces.
IV.   The execution of Java applications begins at method main.
Which of them is correct?
(a)  Both (I) and (III) above                      (b)  Both (II) and  (IV) above
(c)  Both (I) and (II) above                       (d)  (III) and (IV) above
(e)  All (I), (II), (III) and (IV) above.
57.
Consider the following data types in Java :
I.  Int                       II.  Boolean              III.  Double              IV.  String                V.  Array.
Which of them are simple data types?
(a)  Both (I) and (II) above                       (b)  (I), (II), (III) and (IV) above
(c)  (I), (II) and (III) above                         (d)  (II) and (III) above
(e)  All (I), (II), (III), (IV) and (V) above.
58.
For what values respectively of the variables gender and age would the Java expression gender == 1 && age >= 65 become true?
(a)  gender = 1, age = 60                        (b)  gender = 1, age = 50
(c)  gender = 1, age = 65                        (d)  gender = 0, age = 70
(e)  gender = 0, age = 55.
59.
Consider the following Java program :
       public class Compute {

              public static void main (string args [ ])
              {
                     int result, x ;
                     x = 1 ;
                     result = 0;
                     while (x < = 10) {
                            if (x%2 = = 0) result + = x ;
                     + + x ;
              }
              System.out.println(result) ;
              }
       }
Which of the following will be the output of the above program?
(a)  55                     (b)  30                     (c)  25                     (d)  35                     (e)  45.
60.
Which of the following statements about Java Threads is correct?
(a)   Java threads don’t allow parts of a program to be executed in parallel
(b)   Java is a single-threaded language
(c)   Java’s garbage collector runs as a high priority thread
(d)   Ready, running and sleeping are three states that a thread can be in during its life  cycle
(e)   Every java application is not multithreaded.


Answers 


51.
Answer : (e)
Reason : Extending is the mechanism in which reimplementing an inherited method in a sub class to perform a different task from the parent class.
52.
Answer : (c)
Reason : According to the concept of Constructor C is right choice.
53.
Answer : (b)
Reason : Except b above all are contradictory to the functionality of package.
54.
Answer : (e)
Reason : Except e above all are contradictory to the functionality of classes concept of java
55.
Answer : (b)
Reason : The rule of precedence for arithmetic operations is *,/,+or- from left to right.
56.
Answer : (d)
Reason : Remaining all are contradictory to the statements with respect to java.
57.
Answer : (c)
Reason : String and array don’t fall into the category of simple datatypes.
58.
Answer : (c)
Reason : && is the short circuit operator which sees that all conditions should be true then only it will evaluate to true.
59.
Answer : (b)
Reason : B is the right choice remaining all are contradictory to the execution of program
60.
Answer : (d)
Reason : Ready, running and sleeping  which are three states that a thread can be in during its life  cycle.



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



24 comments :

  1. This comment has been removed by the author.

    ReplyDelete
  2. 51 - Re-implementing an inherited method in a sub class to perform a different task from the parent class is called " Overriding " not " extending "

    ReplyDelete
    Replies
    1. They got me confused.I was searching for "overriding" in the options

      Delete
  3. Thanks for sharing this good blog.It's amazing blogJava Online Course

    ReplyDelete
  4. Thanks a lot very much for the high quality and results-oriented help.
    I won’t think twice to endorse your blog post to anybody who wants
    and needs support about this area.

    java training in chennai


    java training in bangalore

    ReplyDelete
  5. Thank you a lot for providing individuals with a very spectacular possibility to develop a knowledge.
    Java training in chennai

    ReplyDelete
  6. Great collection of questions. Thank you. Please share more questions and answers.

    Java Training in Chennai
    Java Training institute in Chennai

    ReplyDelete
  7. 3D Animation and Multimedia Training in Noida
    Best institute for 3d Animation and Multimedia
    Best institute for 3d Animation and Multimedia Course training Classes in Noida- webtrackker Is providing the 3d Animation and Multimedia training in noida with 100% placement supports. for more call - 8802820025.
    Company Address:
    Webtrackker Technology
    C- 67, Sector- 63, Noida
    Phone: 01204330760, 8802820025
    Email: info@webtrackker.com
    Website: http://webtrackker.com/Best-institute-3dAnimation-Multimedia-Course-training-Classes-in-Noida.php



    ReplyDelete
  8. "Graphics designing training institute in Noida
    Best Graphics training institute in Noida, Graphic Designing Course, classes in Noida- webtrackker is
    providing the graphics training in Noida with 100% placement supports. If you are looking for the Best
    Graphics designing training institute in Noida For more call - 8802820025.

    Company address:
    Webtrackker Technology
    C- 67, Sector- 63, Noida
    Phone: 01204330760, 8802820025
    Email: info@webtrackker.com
    Website: http://webtrackker.com/Best-institute-for-Graphic-Designing-training-course-in-noida.php"

    ReplyDelete

  9. Data science Training Institute in Noida

    Data science Training Institute in Noida Accelerate your career in data science by starting from basics in Statistics, Data Management and Analytics to advanced topics like Neural Networks, Machine Learning and Big Data.

    http://webtrackker.com/Best-Data-Science-Training-Institute-in-Noida.php

    WEBTRACKKER TECHNOLOGY (P) LTD.
    C - 67, sector- 63, Noida, India.
    F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

    +91 - 8802820025
    0120-433-0760
    0120-4204716
    EMAIL: info@webtrackker.com
    Website: www.webtrackker.com



    Our Other Courses:

    SAS Training Institute in Delhi
    SAS Training in Delhi

    SAS Training center in Delhi
    Sap Training Institute in delhi
    Best Sap Training center in delhi
    Sap Training in delhi
    Best Software Testing Training Institute in delhi
    Software Testing Training in delhi

    Software Testing Training center in delhi


    Best Salesforce Training Institute in delhi
    Salesforce Training in delhi
    Salesforce Training center in delhi
    Best Python Training Institute in delhi
    Python Training in delhi
    Best Python Training center in delhi
    Best Android Training Institute In delhi
    Android Training In delhi
    best Android Training center In delhi






    Top 20 Reasons to Choose WEBTRACKKER for SAS Training in Delhi

    SAS training in Delhi Facilitate regular, weekend and customized Training in Delhi

    One of the biggest team of certified subject specialist trainers with 5 to 10 years of real Industry Experience

    Free of cost classes for personality development courses including English spoken SAS training in Delhi.

    Smart class room fully latest equipment with projectors, Wi-Fi connectivity and lab facilities available as per your timing.

    An environment for silent discussion zone with group discussion.

    Smart Labs with Real Latest Equipments.

    24x7 Lab Facilities. Students are free to access the labs for unlimited number of hours as per their own preferred timings.

    Best training according to current IT market.

    Facilitate regular, weekend and customized training.

    Free of Cost Personality Development sessions including Spoken English, Group Discussions, Mock Interviews, Presentation skills.

    Gruop Discussions, 24x7 Labs facility is available.

    Smart classrooms fully equipped with projectors and Wi-Fi connectivity.

    Hostel Facilities available at Rs 5,500/month for SAS Training in Delhi students.

    Free Personality Development course including Spoken English, Group Discussions, Mock Interviews, Presentation skills.


    Globally Recognized Course Completion Certificate.

    Good study environment and group discussion with trainer and student.

    Globally Recognized Course Completion Certificate.

    Better relationship between student and trainers.

    The ability to retake the class at no-charge as often as desired..

    One-on One attention by trainers..

    we provide 100% placement assistance

    we prepare the students get placed in top IT firm such as HCL, TCS, Wipro, etc.

    all the well connected with hiring HRs in MNCs

    ReplyDelete

  10. Best Solidworks training institute in noida

    SolidWorks is a solid modeling computer-aided design (CAD) and computer-aided engineering (CAE) computer program that runs on Microsoft Windows. SolidWorks is published by Dassault Systems. Solid Works: well, it is purely a product to design machines. But, of course, there are other applications, like aerospace, automobile, consumer products, etc. Much user friendly than the former one, in terms of modeling, editing designs, creating mechanisms, etc.
    Solid Works is a Middle level, Main stream software with focus on Product development & this software is aimed at Small scale & Middle level Companies whose interest is to have a reasonably priced CAD system which can support their product development needs and at the same time helps them get their product market faster.

    Company Address:

    WEBTRACKKER TECHNOLOGY (P) LTD.
    C-67,Sector-63,Noida,India.

    E-mail: info@webtracker.com

    Phone No: 0120-4330760 ,+91-880-282-0025


    http://webtrackker.com/solidworks-training-Course-institute-in-noida-delhi.php

    Best Solidworks training institute in noida

    ReplyDelete
  11. Full stack developer training in Noida

    Full stack developers work with both the front and back end of a website. They're familiar with HTML, CSS, JavaScript, and one or more back end languages.

    We have developed a whole curriculum spanning on different levels of 3ds training which would make these courses not only an enriching experience but will also leave you content and pleased with attending Webtrackker.


    Company Address:
    Webtrackker Technology
    c-67, sector-63 Noida (India)
    phone:120-4330760, 8802820025
    Email: info@webtrackker.com
    Website:http://webtrackker.com

    artificial intelligence Training in noida

    SAS Training Institute in Delhi

    SAS Training in Delhi

    SAS Training center in Delhi

    Sap Training Institute in delhi

    Sap Training in delhi

    Best Sap Training center in delhi

    Best Software Testing Training Institute in delhi

    Software Testing Training in delhi

    Software Testing Training center in delhi

    Best Salesforce Training Institute in delhi

    Salesforce Training in delhi

    Salesforce Training center in delhi

    Best Python Training Institute in delhi

    Python Training in delhi


    Best Android Training Institute In delhi


    Best Python Training center in delhi


    Android Training In delhi


    best Android Training center In delhi

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

    ReplyDelete
  13. Webtrackker Technology is IT Company and also providing the Solidwork training in Noida at running project by the real time working trainers. If you are looking for the Best Solidwork training institute in Noida then you can contact to webtrackker technology.
    Webtrackker Technology
    C- 67, Sector- 63 (Noida)
    Phone: 0120-4330760, 8802820025

    Solidwork training institute in Noida

    ReplyDelete
  14. webtrackker technology is companey and also providing the solid work training in noida
    at running project by the real time working trainers if you are looking for all best
    http://webtrackker.com/solid warks-training-course-institute-in-noida-delhi:pnp


    ads
    Webtrackker Technology
    C- 67, Sector- 63 (Noida)
    Phone: 0120-4330760, 8802820025

    8802820025
    http://webtrackker.com/solidworks-training-Course-institute-in-noida-delhi.php

    ReplyDelete
  15. Latest News in Hindi

    Latest News in Hindi- Hindustan channel is the best online web portal in india where you read the all latest indian news in hindi. if you are looking the Latest News in Hindi, live news channel, hindi news channel, live news channels in hindi, live hindi channels then hindustan channel is best for you.
    Latest News in Hindi

    Company address:
    C- 67, Sector- 63, Noida
    Phone: 01204330760, 8802820025


    URL: https://hindustanchannel.com

    ReplyDelete
  16. Come & Learn Java from best Java training institute in Ahmedabad and make a successful career with java training institute from Ahmedabad.
    Java training institute in Ahmedabad

    ReplyDelete
  17. Bellsouth Mail Support Contact Number 1-888-259-9444 | JSK Support

    http://jsksupport.com/bellsouth-support.php

    Our Tech support experts Offer throughout the whole day 24*7. We are available all the time for your help, you can contact anytime for Bellsouth Mail Support. Bellsouth Mail Support Toll Free Number for you all issue resolution. Call us @ 1-888-259-9444.
    Bellsouth Mail Support Contact Number 1-888-259-9444 | JSK Support

    ReplyDelete