0

programming languages Online Quiz - 163

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

Which command compiles a Java application named FirstApp?

  1. javac FirstApp

  2. javac FirstApp.java

  3. java FirstApp

  4. java FirstApp.class


Correct Option: B

Which class creates a mutable string that can be used by multiple threads?

  1. String

  2. StringBuffer

  3. StringBuilder

  4. none


Correct Option: B

You are required to represent the employees at a company in Java code. The employees are categorized according to their position and salary. You also need to be able to change the state of an employee due to a promotion. How could you represent this?

  1. Create a Salary object

  2. Declare an Employee class

  3. Declare an instance of the Employee class called Promotion

  4. Declare a promotion method that changes the value of the position variable

  5. Define variables for position and salary


Correct Option: B,D,E

Which of the following are true?

  1. Tags in XML cannot contain spaces in them.

  2. Tag Names can start with a character (A-Z) or an _(Underscore)

  3. Tag Names starting with Underscore cannot have another Underscore in them.

  4. Tag Names cannot start with an Underscore


Correct Option: A,B,C

Pick the true ones from the options

  1. All Valid SGML Documents are Valid XML Documents

  2. XML Can Contain HTML tags

  3. XML is less Complex than SGML

  4. XML can be extended using Optional SGML Extras


Correct Option: C,D

Stylesheets are

  1. A way of doing transformations in XML

  2. Used to change the layout of the XML

  3. Used to induce HTMl effects in XML

  4. None of the above


Correct Option: A,B

Identify the Markup Languages

  1. XML

  2. SGML

  3. HTTP

  4. DCF GML


Correct Option: A,B,C,D

DTD is used to

  1. Create a template of the XML hierachy

  2. Validate the XML

  3. Ensures Well Formed XML’s creation

  4. Format the XML


Correct Option: A,B,C

XSD’s are

  1. The ones which replacecs DTD’s

  2. Helps in creating wellformed XML

  3. Enforces Data Types in XML

  4. Can be inline or external


Correct Option: B,C,D

One of the Tag Names cannot hold user information(CDATA).

  1. <0~id>


Correct Option: D

Which of the following are true in case of XML

  1. XML Enforces Strict Type Checking

  2. XML are strictly non-extendable

  3. XML replaces the old HTML

  4. XML extends HTML


Correct Option: A

XML is a subset of ___________

  1. HTML

  2. WSDL

  3. JSP

  4. SGML


Correct Option: D

Physical Storage units are defined in XML by

  1. ATTLIST

  2. DOCTYPE

  3. ELEMENTS

  4. ENTITIES


Correct Option: D

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

AI Explanation

To answer this question, you need to have a basic understanding of XML (eXtensible Markup Language). Let's go through each option to understand why it is correct or incorrect:

Option A) All the statements are true - This option is incorrect because not all statements can be true simultaneously. We need to evaluate each statement individually.

Option B) All XML elements must have a closing tag - This option is correct. In XML, each element must have a closing tag, except for empty elements, which are self-closing.

Option C) All XML elements must be lowercase - This option is incorrect. XML is case-sensitive, so element names can be in uppercase, lowercase, or a mixture of both.

Option D) All XML documents must have a DTD - This option is incorrect. XML documents do not necessarily require a Document Type Definition (DTD). A DTD is an optional component used to define the structure and rules of an XML document, but it is not mandatory.

The correct answer is B) All XML elements must have a closing tag. This option is correct because it aligns with the basic syntax and rules of XML.

Well formed XML document means

  1. It contains a root element

  2. It contain an element

  3. It contains one or more elements

  4. Must contain one or more elements and root element must contain all other elements


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) It contains a root element - This option is incorrect because an XML document must have a root element, but it can also have additional elements.

Option B) It contains an element - This option is correct because an XML document must contain at least one element. The element serves as the building block for the XML structure.

Option C) It contains one or more elements - This option is partially correct. An XML document can contain one or more elements, so this statement is true. However, it is not the only requirement for a well-formed XML document.

Option D) Must contain one or more elements and the root element must contain all other elements - This option is incorrect. While an XML document must contain one or more elements, the root element does not necessarily have to contain all other elements. Elements can be nested within other elements to create a hierarchical structure.

The correct answer is B) It contains an element. This option is correct because an XML document must contain at least one element to be considered well-formed.

DTD includes the specifications about the markup that can be used within the document, the specifications consists of all EXCEPT

  1. The browser name

  2. The size of element name

  3. Entity declarations

  4. Element declarations


Correct Option: A

The use of a DTD in XML development is

  1. Required when validating XML documents

  2. No longer necessary after the XML editor has been customized

  3. Used to direct conversion using an XSLT processor

  4. A good guide to populating a templates to be filled in when generating an XML document automatically


Correct Option: A
  1. In XMl Declaration

  2. As an Attribute of Root Element

  3. In the ATTLIST

  4. In DTD


Correct Option: D

An Empty element is a

  1. Complex Content

  2. Simpel Content

  3. Hybrid Content

  4. Pre-Defined Content


Correct Option: A

Annotations

  1. Are a part of XML Structure

  2. Are mandatory in XSD

  3. Are Used in Inline and External XSD

  4. None of the above


Correct Option: C
- Hide questions