Maersk - Core And Advanced JAVA


 Core and Advanced Java

1.   Which of the following is a part of t6he Data Access layer in Spring framework?

o  JMS

o  Beans

o  Context

o  Aspects

2.   Variables, methods and constructors which are declared _________ in a superclass can be accessed only by the subclass package or any class within the package of its members class.

o  public

o  private

o  default

o  protected

3.   What will be the output of the following code?

enum Barcode{

         A, b, c, d, e;

}

public class EnumTest {

         public static void main(String[] args) {

                 System.out.println(Barcode.b);

         }

}

4.   Match List I of Collection Type with List II of Mapping & Description.

LIST I

1. java.util.Set

2. java.util.SortedSet

3. java.util.List

4. java.util.Collection

5. java.util.Map 

LIST II

A. This is mapped with a <set> element and initialized with java.util.HashSet

B. This is mapped with a <set> element and initialized with java.util.TreeSet.

C. This is mapped with a <list> element and initialized with java.util.ArrayList

D. This is mapped with a <bag> or <ibag> element and initialized with java.util.ArrayList

E. This is mapped with a <map> element and initialized with java.util.HashMap

 

o  1-B, 2-A, 3-C, 4-D, 5-E

o  1-A, 2-B, 3-C, 4-D, 5-E

o  1-C, 2-B, 3-A, 4-D, 5-E

o  1-C, 2-B, 3-A, 4-E, 5-D

5.   What will be the output of the following code?

public class Example

{

public static void main(String args[])

{

string s1=new String("hello");

String s2="hello";

String s3-s1.intern();

System.out.println(s1==s2);

System.out.println(s2==s3);

         }

}

 

o  true

true

o  false

false

o  true

false

o  false

true

6.   What will be the output of the following code?

import java.util.;

import java.lang.;

import java.io.*;

class Company

{

public static void main(String args[])

{

try {

int a = 0;

int b = 5;

int c = b / a;

System.out.print("Company");

}

catch (Exception e) {

System.out.print("Connect the dots");

}

}

}

o  Compilation error 

o  Runtime error

o  Company

o  Connect the dots

7.   Registry services such as managing information about service providers, service implementations and service metadata are provided by:

o  OSPARQL

o  OREST

o  UDDI

o  WSDL

8.   Suppose a JSP page 'sample.jsp' passed a parameter name in the URL using http://localhost/sample.jsp?name="Peter". The sample.jsp contains the following code:

<%! String myName=request.getParameter(); %>

<% String test= "welcome" + myName; %>

<%= sample %>

The above code will:

o  give a syntax error because of the statement

<%! String myName=request.getParameter();%>

o  give a syntax error because of the statement

<% String test="welcome" + myName; %>

o  give a syntax error because of the statement

<%= test%>

o  prints "welcome Peter"

9.   Which of the following is the correct way to set background image?

o  body {background-image:url('paper.gif');}

o  body {background-image:url('paper.gif')};

o  body {background-image:url('paper.gif')}

o  body {background-image:url(paper.gif);}

10.        Which of the following is the correct option to open a link in a new tab in HTML?

o  <a href="url" new>

o  <a href="url" target="new">

o  <a href= "url" target=tab1>

o  <a href = "url" target="_blank">

11.        If you want to display a textbox with number range shown in the following image, then which of the following code number 2

o  <input type="number" name="quantity" min="1" max="5">

o  <input type="range_val" min="0" max="10" step="2" value="6">

o  <input type="numeric" name="quantity" min="1" max="5">

12.        Which of the following are the advantages of Embedded Style Sheets?

1. Multiple tag types can be created in a single document

2. Styles, in complex situations, can be applied by using Selector and Grouping methods

3. No extra download is required to import the information 4. Multiple documents can be controlled Choose the correct answer from the options given below.

o  Only 3 and 4

o  Only 1 and 2

o  Only 1, 2 and 3

o  Only 2 and 4

13.        How will the browsing histories be affected if the window has child windows?

A. Numerically interleaved

B. Chronologically interleaved

Choose the correct answer from the options given below.

o  Only B

o  Neither A nor B

o  Only A

o  Both A and B

14.        To select the element that is the first child of its parent that is of its type, which of the following selector will be used?

o  strong::first-line {font-size: bigger;}

o  strong:first-type {font-size: bigger;}

o  strong:nth-child {font-size: bigger;}

o  strong:first-of-type {font-size: bigger;}

15.        Suppose you want to display two gauges. One of them measures 30% and the other measures 80% of the total Which of the following codes is correct to implement this?

o  <p>Display a gauge:</p>

<meter value="38" min="1" max="100">30 out of 100</meters><br>

<meter value="0.8">80%</meter>

 

o  <p>Display a gauge:</p>

<check value="30" min="1" max="100">30 out of 100</check><br>

<check value="0.8">80%</check>

 

o  <p>Display a gauge:</p>

<measure value="30" min="1" max-"100">30 out of 100</measure><br>

<measure value="0.8">80%</measure>

 

o  <p>Display a gauge:</p>

<progress value="30" min="1" max="300">30 out of 100</progress><br>

<progress value="0.8">80%</progress>

16.        What will be the output of the following code?

<html> <head> <title>My Page</title>

</head>

<body>

<a href="javascript:myFunction();">Click here</a>

<script language="javascript"  type="text/javascript">

function myFunction() {

alert('Hello world');

    }

    </script>

    </body>

    </html>

o  Click here

Nothing will appear after clicking on it

o  Error in the code

o  Click here

Hello World (On Click)

o  My Page

No comments:

Post a Comment