Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: java question

  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation java question

    I HAVE 4 MC QUESTION . do you know the answers :?


    Q1 - A Java SE method from a framework class CallManager, in package com.ikmnet, has the signature belowMAX 3 ANSWERS)

    String[] getCallerCredentials()

    Creation of a tester class com.mycompany.CallManagerTest has been started and this class needs to access getCallerCredentials to check results. Which of the following changes can ensure that the call is successfully made?
    A. Include CallManager's JAR file in the classpath of CallManagerTest.
    B. Make CallManagerTest a subclass of CallManager.
    C. Within CallManagerTest, declare an instance of CallManager as public.
    D. Move the class CallManagerTest to com.ikmnet and change the package declaration of CallManagerTest to:
    package com.ikmnet;
    E. Qualify the call with the classname com.ikmnet.CallManager.getCallerCredentials().




    Q2 Which of the following are NOT legal Java SE method signatures?(MAX 3 ANSWERS)
    A. volatile BigDecimal findRoot(BigDecimal number)
    B. BigDecimal findRoot(BigDecimal number)
    C. transient BigDecimal findRoot(BigDecimal number)
    D. synchronized BigDecimal findRoot(BigDecimal number)
    E. private static BigDecimal findRoot(BigDecimal number)







    Q3 - Which of the following statements correctly describe how Java ClassLoader works for the class below?(MAX 3 ANSWERS)
    package src.com.test
    class ClassLoaderDemo {
    }



    A.
    The first request to load the ClassLoaderDemo class will come to the Bootstrap ClassLoader.



    B.
    To explicitly load the ClassLoaderDemo class, use the code below:
    try{
    Class.forName("src.com.test.ClassLoaderDemo", true, classLoaderDemo.class.getClassLoader().getParent() );
    } catch (ClassNotFoundException e) {
    }



    C.
    When a request to load ClassLoaderDemo class comes to the Extension ClassLoader, it will look into the jre/lib/ext directory for the class.



    D.
    The java.lang.ClassLoader class will first call its findClass() method to find the ClassLoaderDemo class, and then call its loadClass() method to load the ClassLoaderDemo class.



    E.
    The class ClassLoaderDemo will be loaded by Java using the three default class loaders below:
    Bootstrap ClassLoader
    Extension ClassLoader
    Application ClassLoader




    Q4 Which of the following statements correctly describe the syntax of the try-catch-finally construct in Java SE Exception Handling?(MAX 3 ANSWERS)


    A.
    finally blocks and catch blocks must always appear in conjunction with a try block.

    B.
    A finally block must be preceded by the catch block.

    C.
    The try block must be followed by either a catch block or a finally block.

    D.
    All the catch blocks that appear in the try block will be executed.

    E.
    A try block must be followed by a finally block.

  2. #2
    Member
    Join Date
    Sep 2018
    Location
    Virginia
    Posts
    284
    My Mood
    Cool
    Thanks
    0
    Thanked 38 Times in 36 Posts

    Default Re: java question

    Yes, I do! (But if I didn't I would simply check my textbook or write some code to check them out).

    Regards,
    Jim

Similar Threads

  1. Replies: 1
    Last Post: November 1st, 2012, 07:54 AM
  2. Help with a java question...
    By Huw in forum Java Theory & Questions
    Replies: 8
    Last Post: September 20th, 2012, 01:25 PM
  3. Challenging Java Question: Test your Java skill by grouping these terms
    By karthickk3 in forum Java Theory & Questions
    Replies: 3
    Last Post: July 18th, 2012, 10:10 PM
  4. help for this java question
    By marlontoyo in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 20th, 2011, 08:09 PM
  5. Java Question
    By NiCKYmcd in forum Java Theory & Questions
    Replies: 1
    Last Post: August 25th, 2010, 08:47 AM

Tags for this Thread