0

web technology Online Quiz - 121

Description: web technology Online Quiz - 121
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0

XAML Stands for?

  1. Extended Application Markup Language

  2. Extensible Application Markup Language

  3. Extensible Application Manipulation Language

  4. None of the above


Correct Option: B

Xap Stands for

  1. Extended Application Language

  2. Silverlight Application Package

  3. Extended Application Program

  4. None


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of XAP.

Option A) Extended Application Language - This option is incorrect because XAP does not stand for Extended Application Language.

Option B) Silverlight Application Package - This option is correct. XAP stands for Silverlight Application Package. In Microsoft Silverlight, XAP files are used to package and distribute applications.

Option C) Extended Application Program - This option is incorrect because XAP does not stand for Extended Application Program.

Option D) None - This option is incorrect because XAP does have a meaning, which is Silverlight Application Package.

The correct answer is B) Silverlight Application Package.

What was silverlight first call?

  1. WPF\E

  2. Silverlight

  3. WPF

  4. WPE


Correct Option: A

Which is Backend Programming language for Silverlight

  1. java

  2. C#

  3. C

  4. Unix


Correct Option: B

We Can add normal project reference (normal class library) to the Silverlight project?

  1. True

  2. False


Correct Option: A

What does HTML stand for?

  1. Hyper Text Markup Language

  2. Home Tool Markup Language

  3. Hyperlinks and Text Markup Language

  4. Highlight and Text Markup Language


Correct Option: A

Who is making the Web standards?

  1. The World Wide Web Consortium

  2. Microsoft

  3. Mozilla

  4. Sun Microsystems


Correct Option: A

Choose the correct HTML tag for the largest heading:


Correct Option: C

What is the correct HTML for adding a background color?

  1. yellow


Correct Option: C

What is the correct HTML for creating a hyperlink?


Correct Option: C

Which of these tags are all tags?


Correct Option: A

package simplejava; public class TestConstructor1 { int p; TestConstructor1() { System.out.println("I am in Constructor"); } TestConstructor1(int p) { this.p =p; System.out.println("p = "+p); this(); } public static void main(String[] args) { TestConstructor1 tp1 = new TestConstructor1(10); } }

  1. p = 10

  2. p = 0

  3. Compiler Error

  4. Exception


Correct Option: C

Main purpose to design XML is

  1. save and transport data

  2. how to reuse data

  3. to made connection b/w data

  4. how to use data


Correct Option: A

Given: class Top { public Top(String s) { System.out.print("B"); } } public class Bottom2 extends Top { public Bottom2(String s) { System.out.print("D"); } public static void main(String [] args) { new Bottom2("C"); System.out.println(" "); } } What is the result?

  1. BD

  2. DB

  3. BDC

  4. DBC

  5. Compilation fails


Correct Option: E

AI Explanation

To answer this question, we need to understand the concept of inheritance and constructor chaining in Java.

In the given code, we have two classes: Top and Bottom2. The Bottom2 class extends the Top class, which means that Bottom2 inherits from Top. When a class extends another class, it inherits all the fields and methods of the parent class.

The Top class has a constructor that takes a String parameter and prints "B" when called. The Bottom2 class also has a constructor that takes a String parameter and prints "D" when called.

In the main method of the Bottom2 class, we create a new Bottom2 object and pass the string "C" as a parameter to the constructor. This will invoke the Bottom2 constructor. However, before the Bottom2 constructor is called, the parent Top constructor is called implicitly.

Here's the constructor chaining that occurs:

  1. The Bottom2 constructor is called.
  2. Since Bottom2 extends Top, the parent Top constructor is called first.
  3. The Top constructor prints "B".
  4. Then, the Bottom2 constructor prints "D".

Therefore, the output will be "BD". However, the correct answer is E - Compilation fails.

The reason for this is that the code does not provide an explicit call to the parent constructor in the Bottom2 constructor. Since the Top class does not have a default constructor (a constructor with no parameters), the Java compiler will not generate a default call to the parent constructor. Therefore, if you try to compile this code as is, it will result in a compilation error.

To fix this error, you can add an explicit call to the parent constructor using the super keyword in the Bottom2 constructor. Here's an example of how you can modify the code to compile successfully:

public Bottom2(String s) {
   super(s); // explicit call to the parent constructor
   System.out.print("D");
}

With this modification, the output will be "BD".

Which statement(s) are true? (Choose all that apply.)

  1. Cohesion is the OO principle most closely associated with hiding implementation details

  2. Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs

  3. Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose

  4. Cohesion is the OO principle most closely associated with allowing a single object to be seen as having many types


Correct Option: C

Given: 3. class Mammal { 4. String name = "furry "; 5. String makeNoise() { return "generic noise"; } 6. } 7. class Zebra extends Mammal { 8. String name = "stripes "; 9. String makeNoise() { return "bray"; } 10. } 11. public class ZooKeeper { 12. public static void main(String[] args) { new ZooKeeper().go(); } 13. void go() { 14. Mammal m = new Zebra(); 15. System.out.println(m.name + m.makeNoise()); 16. } 17. } What is the result?

  1. furry bray

  2. stripes bray

  3. furry generic noise

  4. stripes generic noise

  5. Compilation fails

  6. An exception is thrown at runtime


Correct Option: A

AI Explanation

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

Option A) furry bray - This option is the correct answer. The code creates an instance of the ZooKeeper class and calls the go() method. Inside the go() method, a new Zebra object is created and assigned to a Mammal reference variable m. When we call m.name, it refers to the name variable in the Mammal class, which is "furry". When we call m.makeNoise(), it invokes the makeNoise() method in the Zebra class, which returns "bray". Therefore, the output will be "furry bray".

Option B) stripes bray - This option is incorrect because m.name refers to the name variable in the Mammal class, which is "furry", not "stripes".

Option C) furry generic noise - This option is incorrect because m.makeNoise() invokes the makeNoise() method in the Zebra class, which returns "bray", not "generic noise".

Option D) stripes generic noise - This option is incorrect because m.name refers to the name variable in the Mammal class, which is "furry", not "stripes". Additionally, m.makeNoise() invokes the makeNoise() method in the Zebra class, which returns "bray", not "generic noise".

Option E) Compilation fails - This option is incorrect. The code compiles successfully without any compilation errors.

Option F) An exception is thrown at runtime - This option is incorrect. The code does not throw any exceptions at runtime.

The correct answer is Option A) furry bray. This option is correct because it correctly represents the output of the code snippet.

  1. ClassD has low cohesion

  2. ClassA has weak encapsulation

  3. ClassB has weak encapsulation

  4. ClassB has strong encapsulation

  5. ClassC is tightly coupled to ClassA


Correct Option: C

Given: 3. import java.io.*; 4. public class ReadingFor { 5. public static void main(String[] args) { 6. String s; 7. try { 8. FileReader fr = new FileReader("myfile.txt"); 9. BufferedReader br = new BufferedReader(fr); 10. while((s = br.readLine()) != null) 11. System.out.println(s); 12. br.flush(); 13. } catch (IOException e) { System.out.println("io error"); } 16. } 17. } And given that myfile.txt contains the following two lines of data: ab cd What is the result?

  1. ab

  2. abcd

  3. ab cd

  4. a b c D

  5. Compilation fails


Correct Option: E

XML stands for

  1. eXtra Markup Language

  2. eXplore Markup Language

  3. eXpensive Markup Language

  4. eXtensible Markup Language


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of XML (eXtensible Markup Language).

Option A) eXtra Markup Language - This option is incorrect because XML does not stand for "eXtra" Markup Language. XML is not specifically designed to provide extra markup, but rather to provide a flexible and extensible way to structure and store data.

Option B) eXplore Markup Language - This option is incorrect because XML does not stand for "eXplore" Markup Language. XML is not primarily used for exploring or browsing purposes, but rather for storing and exchanging data.

Option C) eXpensive Markup Language - This option is incorrect because XML does not stand for "eXpensive" Markup Language. The cost of using XML is not related to its name; it is a widely-used and freely available markup language.

Option D) eXtensible Markup Language - This option is correct because XML stands for "eXtensible" Markup Language. XML is designed to be easily readable by humans and machines, and it allows users to define their own markup elements and tags.

The correct answer is D) eXtensible Markup Language.

- Hide questions