Skip to main content

Accenture Mock Quiz | Part 3

 

Question 21

Correct
Marked out of 1.00
Flag question

Question text

Identify the predicate which selects the last Employee element that is the child of the Company element?


Select one:
 

Feedback

Question 22

Incorrect
Marked out of 1.00
Flag question

Question text

Find out the well-formed xml file

Select one:
 

Feedback

Question 23

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

public class ApplicationTester 
{ 
  public static void main(String[] args)
  {
    int i=0; 
    for(i=0; i<10; i++)
    {
      if(i == 5)
      {
        continue; 
      }
      i++; 
      System.out.print(i + " "); 
    }
  }
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 24

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

class StringSample 
{ 
  public StringSample(String string) 
  { 
    System.out.println("The string is " + string); 
  } 
} 
public class ConstructorTester1 
{ 
  public static void main(String[] args) 
  { 
    StringSample stringSample = new StringSample(); 
    StringSample stringSample1 = new StringSample("Test String"); 
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 25

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

 public class Rectangle 
{ 
  private int length; 
  private int width; 
  public static void main(String[] args) 
  { 
    Rectangle rectangle1 = new Rectangle(); 
    rectangle1.length=10; 
    rectangle1.width=5; 
    Rectangle rectangle2 = rectangle1; 
    System.out.println("Length : "+rectangle2.length); 
    System.out.println("Width : "+rectangle2.width);
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 26

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

 public class MyClass 
{ 
  private static int data; 
  static
  { 
    MyClass.data = 999; 
  } 
  public static int getData() 
  { 
    return data; 
  } 
  public static void setData(int data) 
  {
    MyClass.data = data; 
  } 
} 
public class ApplicationTester 
{
  public static void main(String[] args)
  { 
    MyClass ref1 = new MyClass(); 
    MyClass ref2 = new MyClass();
    System.out.print(ref1.getData()); 
    ref2.setData(111); 
    System.out.println(" " + ref1.getData());
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 27

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

 class Event
{ 
  static int eventId; 
  public static void main(String[] args) 
  { 
    Event e1=new Event(); 
    e1.eventId=100; 
    Event e2=e1; e2.eventId=200;
    Event e3=new Event(); 
    System.out.println(e1.eventId+ " "+ e2.eventId + " "+ e3.eventId); 
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 28

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

 public class Vehicle 
{
  protected String enginePower;
  public Vehicle()
  { 
    this.enginePower = "100CC";
  } 
  public String getEnginePower()
  { 
    return this.enginePower; 
  } 
} 
public class PassengerVehicle extends Vehicle
{ 
private int capacity; 
public PassengerVehicle()
{ 
this.capacity = 50; 
this.enginePower = "150CC"; 
} 
public int getCapacity()
{ 
return this.capacity; 
} 
}
public class ApplicationTester 
{ 
  public static void main(String[] args)
  { 
    Vehicle vehicle = new PassengerVehicle(); 
    System.out.println(vehicle.getEnginePower());
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 29

Correct
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?


public class ApplicationTester {

           public static void main(String[] args) {

                 int [] array1 = {10,20,30,40,50};

                 int [] array2 = array1;

                 for(int index1=0,index2=3; index2<array2.length&&index1<array1.length; index1++,++index2)

                   {

                                array1[index1]++;

                                System.out.print(array2[index2]+” ”);

                   }

         }

}


Select one:
 

Feedback

Question 30

Incorrect
Marked out of 1.00
Flag question

Question text

What will be the output of the following Java code?

 
public class ApplicationTester 
 { 
   public static void main(String[] args)
   { 
     int[] array = {-9,-11-8,-100,-78}; 
     int minimum = 0; 
     for(int index=0; index < array.length; index++)
     { 
       if(minimum < array[index])
       { minimum = array[index]; 
       }
     }
     System.out.println(minimum); 
   } 
 }
Choose the most appropriate option.

Select one:
 

Feedback

Comments

Must Read:

RDBMS Data Definition Language | Purge Distributor table Truncate

 RDBMS  Data Definition Language  Purge Distributor table Truncate The mobile management wants to purge all the records from the “Distributor “table.  Write an SQL statement to purge all the records from the distributor table without allowing rollback activity. Evaluation Result: Result Description Summary of tests +------------------------------+ | 1 tests run / 1 test passed | +------------------------------+

Software Engineering Concepts Basics Of Testing Basics Of Testing | Quiz 2

Software Engineering Concepts  Basics Of Testing  Basics Of Testing Quiz 2

Data Formats ( XML & JSON ) XML AND JSON | Generate XSD for Persons

  Generate XSD for Persons Generate XSD for the following XML. XYZ organization wants to store the details of persons in an xml file. The following scenario helps in designing the XML document. Here PersonList  is the root tag. PersonList contains the entry of each person with adhaarno, name, age and address. <?xml version="1.0"  encoding="UTF-8"?> <PersonList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PersonList.xsd">     <Person>         <adhaarno>414356782345</adhaarno>         <name>             <firstname>Zeenath</firstname>         </name>         <age>28</age>         <address>             <doorno...

UNIX Introduction to Unix | Pre-Quiz

  Feedback Congratulations! You have passed by securing more that 80%. Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text  Solaris is the name of a flavor of UNIX from _____________. Select one: a.  HP  b.  Sun Microsystems   c.  IBM  d.  Digital Equipment Corp Feedback Your answer is correct. The correct answer is: Sun Microsystems Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text Match the following: HP-UX Answer 1 Choose... IBM Redhat Hewlett Packard Sun Microsystem   AIX             Answer 2 Choose... IBM Redhat Hewlett Packard Sun Microsystem   Linux Answer 3 Choose... IBM Redhat Hewlett Packard Sun Microsystem   Solaris Answer 4 Choose... IBM Redhat Hewlett Packard Sun Microsystem   Feedback Your answer is correct. The correct answer is: HP-UX → Hewlett Packard, AIX             → IBM, Linux → Redhat,...

Mock 3 Slot3 - Handson - 21st July Java (30 Marks) 1. Farm Fest

Anuj has a mango farm. He sells the mangoes and earns money from them. He fills the mangoes in a basket. To make the calculation much simpler, he fills the basket either with an odd number of mangoes or with an even number of mangoes. If the number of mangoes is a combination of both an even and an odd number of mangoes, then he needs to rearrange the basket. Note: Number of baskets cannot exceed 10 and cannot be zero or less, If so print “Invalid number of baskets”. A negative number of mangoes cannot exit, if so print "Invalid Input". Sample Input 1: Number of baskets 5 Number of mangoes in each basket 2 4 6 8 10 Sample Output 1: Even Sample Input 2: Number of baskets 4 Number of mangoes in each basket 13 29 45 5 Sample Output 2: Odd Sample Input 3: Number of baskets 3 Number of mangoes in each basket 12 13 14 Sample Output 3: Rearrange the mangoes Sample Input 4: Number of baskets 0 Sample Output 4: Invalid number of baskets Sample Input 5: Number of baskets 2 Number of ma...

Software Engineering Concepts Configuration Management And Version Control Configuration Management And Version Control Quiz 2

Software Engineering Concepts        Configuration Management And Version Control             Configuration Management And Version Control Quiz 2  

Accenture TFA MCQ | Part 1

Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text   Identify whether the below statement is True or False: The hierarchy of Reader/Writer class is character-oriented and InputStream/OutputStream class is byte-oriented Select one: True   False Feedback The correct answer is 'True'. Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text While garbage collection the java run time system automatically calls ______________method. Select one: a.  finalize()   b.  finalizer() c.  finally() d.  finalized() Feedback The correct answer is: finalize() Question  3 Partially correct Mark 0.67 out of 1.00 Flag question Question text Choose all the statement(s) that are valid. Select one or more: a.  There is only single copy of member function in memory when a class is loaded b.  A super class is an incomplete class that requires further specification c.  Two classes in two different packages can have ...

Programming using Java Hands On - Control Structures | Highest Placement

  Highest Placement SRV college wants to recognize the department which has succeeded in getting the maximum number of placements for this academic year. The departments that have participated in the recruitment drive are CSE,ECE, MECH. Help the college find the department getting maximum placements. Check for all the possible output given in the sample snapshot Note : If any input is negative, the output should be "Input is invalid".  If all department has equal number of placements, the output should be "None of the department has got the highest placement". Sample Input 1: Enter the no of students placed in CSE:90 Enter the no of students placed in ECE:45 Enter the no of students placed in MECH:70 Sample  Output 1: Highest placement CSE Sample Input 2: Enter the no of students placed in CSE:55 Enter the no of students placed in ECE:85 Enter the no of students placed in MECH:85 Sample  Output 2: Highest placement ECE MECH Sample Input 3: Enter the no of students p...

Subscribe to Get's Answer by Email