Advanced java mcq questions with answers pdf

 

    You also could read on-line Advanced Java Mcq Questions. With Answers Pdf Msbte in our internet site. Get guide in pdf, word, txt, ppt, zip. This set of Advanced Java Multiple Choice Questions & Answers Which page directive should be used in JSP to generate a PDF page?. 5 days ago Advanced Java Mcq Questions With Answers - [Free] Advanced Java Mcq Answers [PDF] [EPUB] Javascript Interview Questions: Read +.

    Author:ALLEEN HEINEMEYER
    Language:English, Spanish, French
    Country:Cambodia
    Genre:Technology
    Pages:153
    Published (Last):07.06.2016
    ISBN:543-4-70383-251-1
    Distribution:Free* [*Sign up for free]
    Uploaded by: BRETT

    68097 downloads 143354 Views 30.72MB PDF Size Report


    Advanced Java Mcq Questions With Answers Pdf

    This set of Advanced Java Multiple Choice Questions & Answers (MCQs) focuses on Advanced java programming multiple choice questions with answers pdf. Advanced java multiple choice questions and answers will help you to be more knowledgeable because they can give you ideas on questions and answers. Review the ebook Advanced Java Mcq Questions With Answers Pdf Msbte by domarepthestten.ml Study online at here. Next to, you could also.

    A d 44 The blank space in the following sentence has to be correctly filled : Members of a class specified as ……………….. A d 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. A b 48 In Java, a try block should immediately be followed by one or more ……………….. A d 49 An abstract data type typically comprises a …………… and a set of ……………… respectively. A e 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. A c 53 Consider the following statements about Java packages: I. Packages provide a visibility control mechanism. One of the important properties of a package is that all classes defined inside a package is accessible by code outside that package. Which of them is correct? A b 54 Consider the following statements: I. A class can be declared as both abstract and final. A class declared as final can be extended by defining a sub-class.

    Competitors may use any programming language and development environment to obtain their solutions. It's a global competitive programming platform and has a large community of programmers that helps students and professionals test and improve their coding skills.

    Its objective is to provide a platform for practice, competition and improvement for both students and professional software developers. Apart from this, it aims to reach out to students while they are young and inculcate a culture of programming in India. It holds a staggering amount of problems prepared by its community of problem setters or taken from previous programming contests, some of which are great problems for practice refer to the Problem classifiers section. SPOJ also allows advanced users to organize contests under their own rules.

    It's home to many classic problems from the Chinese IOI scene. It has a lot of great problems from programming competitions in Japan. Thousands of problems, including many classic ones, are featured here.

    However, it is strongly advised that you practice with uHunt following its "Competitive Programming Exercise" section. Arrays Questions and Answers 1. Which of these operators is used to allocate memory to array variable in Java? Arrays Questions and Answers 2. Which of these is an incorrect array declaration? Arrays Questions and Answers 3. What will this code print? Which of these is an incorrect Statement?

    Arrays Questions and Answers 5. Which of these is necessary to specify at time of array initialization? Collections Questions and Answers 1. Which of these packages contain all the collection classes? Collections Questions and Answers 2. Collections Questions and Answers 3.

    Collections Questions and Answers 4. Which of these methods deletes all the elements from invoking collection?

    Collections Questions and Answers 5. What is Collection in Java? When does Exceptions in Java arises in code sequence? Which of these keywords is not a part of exception handling? Which of these keywords must be used to monitor for exceptions? Which of these keywords must be used to handle the exception thrown by try block in some rational manner?

    Which of these keywords is used to manually throw an exception? Input Output Streams Questions and Answers 1. Input Output Streams Questions and Answers 2. Input Output Streams Questions and Answers 3. Which of these is a type of stream in Java? Input Output Streams Questions and Answers 4. Which of these classes are used by Byte streams for input and output operation? Input Output Streams Questions and Answers 5. Which of these classes are used by character streams for input and output operations?

    Which of these keywords is used to define interfaces in Java? Which of these can be used to fully abstract a class from its implementation? Which of these access specifiers can be used for an interface? Using serialization, object's state is saved and converted into byte stream. The byte stream is transferred over the network and the object is re-created at destination. Ans: Try block needs to be followed by either Catch block or Finally block or both.

    Any exception thrown from try block needs to be either caught in the catch block or else any specific tasks to be performed before code abortion are put in the Finally block. Is there any way to skip Finally block of exception even if some exception occurs in the exception block? Ans: If an exception is raised in Try block, control passes to catch block if it exists otherwise to finally block. Finally block is always executed when an exception occurs and the only way to avoid execution of any statements in Finally block is by aborting the code forcibly by writing following line of code at the end of try block: System.

    When the constructor of a class is invoked? Ans: The constructor of a class is invoked every time an object is created with new keyword. For example, in the following class two objects are created using new keyword and hence, constructor is invoked two times. Can a class have multiple constructors? Ans: Yes, a class can have multiple constructors with different parameters.

    Which constructor gets used for object creation depends on the arguments passed while creating the objects. Can we override static methods of a class? Ans: We cannot override static methods.

    Static methods belong to a class and not to individual objects and are resolved at the time of compilation not at runtime. Even if we try to override static method,we will not get an complitaion error,nor the impact of overriding when running the code.

    In the below example, what will be the output? Is String a data type in java? Ans: String is not a primitive data type in java. When a string is created in java, it's actually an object of Java.

    String class that gets created. After creation of this string object, all built-in methods of String class can be used on the string object.

    JAVA Questions and Answers

    In the below example, how many String Objects are created? String class are created. Why Strings in Java are called as Immutable? Ans: In java, string objects are called immutable as once value has been assigned to a string, it can't be changed and if changed, a new object is created. In below example, reference str refers to a string object having value "Value one". What's the difference between an array and Vector? Ans: An array groups data of same primitive type and is static in nature while vectors are dynamic in nature and can hold data of different data types.

    What is multi-threading? Ans: Multi threading is a programming concept to run multiple tasks in a concurrent manner within a single program.

    Threads share same process stack and running in parallel. It helps in performance improvement of any program.

    Table of Content

    Why Runnable Interface is used in Java? Ans: Runnable interface is used in java for implementing multi threaded applications. Runnable interface is implemented by a class to support multi threading. What are the two ways of implementing multi-threading in Java? Ans: Multi threaded applications can be developed in Java by using any of the following two methodologies: 1. By using Java. Runnable Interface. Classes implement this interface to enable multi threading.

    There is a Run method in this interface which is implemented. By writing a class that extend Java. Thread class. When a lot of changes are required in data, which one should be a preference to be used?

    Java Multiple Choice Questions - GeeksforGeeks

    String or StringBuffer? Ans: Since StringBuffers are dynamic in nature and we can change the values of StringBuffer objects unlike String which is immutable, it's always a good choice to use StringBuffer when data is being changed too much. If we use String in such a case, for every data change a new String object will be created which will be an extra overhead. What's the purpose of using Break in each case of Switch Statement? Ans: Break is used after each case except the last one in a switch so that code breaks after the valid case and doesn't flow in the proceeding cases too.

    If break isn't used after each case, all cases after the valid case also get executed resulting in wrong results. How garbage collection is done in Java? Ans: In java, when an object is not referenced any more, garbage collection takes place and the object is destroyed automatically.

    For automatic garbage collection java calls either System. How we can execute any code even before main method? Ans: If we want to execute any statements before even creation of objects at load time of class, we can use a static block of code in the class. Any statements inside this static block of code will get executed once at the time of loading the class even before creation of objects in the main method. Can a class be a super class and a sub-class at the same time?

    Ans: If there is a hierarchy of inheritance used, a class can be a super class for another class and a sub-class for another one at the same time. In the example below, continent class is sub-class of world class and it's super class of country class. How objects of a class are created if no constructor is defined in the class?

    Related articles:


    Copyright © 2019 domarepthestten.ml. All rights reserved.