0

programming languages Online Quiz - 162

Description: programming languages Online Quiz - 162
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Which statement is true?

  1. All the statements are true

  2. All XML elements must have a closing tag

  3. All XML elements must be lower case

  4. All XML documents must have a DTD


Correct Option: B

XSLT

  1. Improves Server Performance

  2. Allows customize data presentations

  3. Replaces XML

  4. Used to store xml to databases


Correct Option: B

What is the correct syntax of the declaration which defines the XML version?:

  1. None of the above


Correct Option: C

Move by name performs

  1. Resets the values

  2. Copies the values of mathcing column names

  3. Copies and rests the value specified

  4. None of the above


Correct Option: B

Command used to refine the declared variables

  1. REASSIGN

  2. REDECLARE

  3. REDEFINE

  4. None of the above


Correct Option: C

Use of Examine command

  1. Inspect the content of an alphanumeric

  2. Inspect the content of a binary field

  3. Range of fields within an array

  4. Add a pattern

  5. Delete a pattern

  6. None of the above


Correct Option: A,B,C,E

What will be the ouput of the following code snippet? StringBuffer myBuffer = new StringBuffer(15); myBuffer.append("Hello World!"); System.out.println(myBuffer.length()+","+ myBuffer.capacity());

  1. 15,15

  2. 12,12

  3. 12,15

  4. 15,12


Correct Option: C

What will be the ouput of the following code snippet? String myString1 = "Java"; String myString2 = new String("Java"); System.out.println(myString1 == myString2 ^ myString1.equals(myString2));

  1. True

  2. False


Correct Option: A

What will be the ouput of the following code snippet? String myString1 = "Hello World!"; myString1.replace('e', 'o'); System.out.println(myString1);

  1. Hallo World!

  2. Hello World!

  3. Compile time error

  4. NullPointerException


Correct Option: B

What will be the ouput of the following code snippet? StringBuffer myBuffer = new StringBuffer("Java Programming"); myBuffer.setLength(12); System.out.println(myBuffer);

  1. Java Programming

  2. Compile time error

  3. Throws exception

  4. Java Program


Correct Option: D

AI Explanation

To answer this question, let's go through each line of the code snippet:

StringBuffer myBuffer = new StringBuffer("Java Programming");

This line creates a StringBuffer object named myBuffer and initializes it with the string "Java Programming".

myBuffer.setLength(12);

This line sets the length of the myBuffer StringBuffer object to 12. This means that the StringBuffer will only contain the first 12 characters of the original string "Java Programming".

System.out.println(myBuffer);

This line prints the myBuffer StringBuffer object. Since the length of myBuffer was set to 12, it will only contain the first 12 characters of the original string "Java Programming".

Therefore, the output of the code snippet will be:

D. Java Program

The correct answer is D.

Among the following what is the advantage of StringBuilder over StringBuffer?

  1. Faster performance

  2. Methods are synchronised

  3. Thread-safety

  4. Multithreading


Correct Option: A

What will be the ouput of the following code snippet? String myString = new String("Java"); StringBuffer myBuffer = new StringBuffer("Java"); myString.replace('a','o'); myBuffer.replace('a','o'); System.out.println(myString+","+myBuffer);

  1. Jovo,Jovo

  2. Java,Jovo

  3. Java,Java

  4. Compile time error


Correct Option: A

Which of the following is tested when all the test units are run using testdrv -p

  1. Code Logic

  2. Code Coverage

  3. Memory leaks

  4. All of the above


Correct Option: D

As per the Coding Guidelines of the Project, Which of the following follows the spacing guidelines while using operators

  1. anyVal=10;

  2. anyVal = 10;

  3. anyVal= 10;

  4. anyVal =10;


Correct Option: B

As per the Coding Guidelines of the Project, Which of the following follows guidelines while declaring Pointer

  1. char* text;

  2. char *text;

  3. Char * text;

  4. char text*;


Correct Option: A

Which of the following is the only category of Messages where the developer should place information for his debugging purposes

  1. TRACE (T)

  2. BUSINESS_INFO (N)

  3. SERIOUS_WARNING (S)

  4. BUSINESS_WARNING (G)


Correct Option: A

As per the Coding Guidelines of the Project, Which of the following is a valid filename ?

  1. ClassName.cpp

  2. Classname.cpp

  3. Class.name.cpp

  4. Class_Name.cpp


Correct Option: A

As per the Coding Guidelines of the Project, Which of the following is a valid Class Attribute ?

  1. mMemberAttribute

  2. mmemberAttribute

  3. MemberAttribute

  4. member_attribute


Correct Option: A

Which of the following directory in an MDDS instance contains initialisation files which are used during MDDS installation (data files, but installation scripts

  1. bin

  2. etc

  3. data/boc/manual/incoming

  4. None of the above


Correct Option: B

Which clearcase command is used to create a new element

  1. mkelem

  2. mvelem

  3. mkview

  4. ctelem


Correct Option: A
- Hide questions