Tag: technology

Questions Related to technology

  1. Overriding the populate method of the ActionForm

  2. Overriding the processPopulate method of the Request Processor

  3. Overriding the populateBean method of the ActionMapping

  4. None


Correct Option: B
  1. Always converts HTML markup to entity equivalents, like <

  2. Never converts HTML markup to entity equivalents

  3. Converts markup when filter=true

  4. Converts markup when markup=false


Correct Option: C
  1. Call the reset method if validation fails

  2. Set the tag's redisplay property to false

  3. Set the tag's reset property to false

  4. Use a plain html tag instead


Correct Option: B
  1. Locale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ “ “+ df.format(d));

  2. Locale bc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ “ “+ df.setDateFormat(d));

  3. Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+ “ “+ df.setDateFormat(d));

  4. Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+ “ “ + df.format(d));


Correct Option: D
Explanation:

To solve this question, the user needs to understand the concepts of Locale, Date, and DateFormat objects.

Option A is incorrect because there is no such method as getLocale() in the Locale class. The correct method is getDefault(). Additionally, df.format(d) is used to format the date object d using the date format df. This option is incorrect because df.format(d) is called with a space between the method name and the parentheses.

Option B is incorrect because Locale.getLocale() is not a valid method in the Locale class. Also, df.setDateFormat(d) is not a valid method in the DateFormat class. Instead, df.format(d) should be used to format the Date object using the appropriate format.

Option C is incorrect because Locale.getDefault() is not used to get the current locale. Instead, Locale.getLocale() is used, which is not a valid method in the Locale class. df.setDateFormat(d) is also not a valid method in the DateFormat class. Instead, df.format(d) should be used to format the Date object using the appropriate format.

Option D is correct. Locale.getDefault() is used to get the current locale, and df.format(d) is used to format the Date object d using the appropriate date format. This option will output the current locale's country name and the appropriate version of the date object d.

Therefore, the correct answer is:

The Answer is: D

  1. The class is fully encapsulated

  2. The ownerName variable breaks encapsulation

  3. The cardlD and limit variables break polymorphism

  4. The setCardlnformation method breaks encapsulation


Correct Option: B
Explanation:

To solve this question, the user needs to understand the concepts of encapsulation and polymorphism.

Encapsulation is the concept of hiding the implementation details of a class and making the variables and methods private to ensure that they cannot be accessed from outside the class.

Polymorphism, on the other hand, is the ability of an object to take on many forms, depending on the context in which it is used.

Now let's examine each option and determine which is true:

A. The class is fully encapsulated: This option is incorrect. While the class does have private variables (cardlD and limit), the ownerName variable is public, which means it can be accessed from outside the class. Therefore, the class is not fully encapsulated.

B. The ownerName variable breaks encapsulation: This option is correct. The ownerName variable is declared as public, which means it can be accessed and modified from outside the class. This breaks the concept of encapsulation because the implementation details of the class are not fully hidden.

C. The cardlD and limit variables break polymorphism: This option is incorrect. The cardlD and limit variables have nothing to do with polymorphism. They are private variables that can only be accessed from within the class.

D. The setCardlnformation method breaks encapsulation: This option is incorrect. The setCardlnformation method is a public method, which is used to set the values of the private variables. It does not break encapsulation because it is providing a controlled way of accessing the private variables.

Therefore, the correct answer is:

The Answer is: B

  1. class Man { private Dog }

  2. class Man { private BestFriend dog; }

  3. class Man { private Dog bestFriend; }

  4. class Man implements Dog { }


Correct Option: C
Explanation:

To properly represent the relationship "Man has a best friend who is a Dog", we need to use composition to indicate that a Man object has a Dog object as its best friend.

Now, let's go through each option and explain why it is right or wrong:

A. class Man { private Dog }

This option is incorrect. The syntax used to represent the relationship between Man and Dog is incorrect. The "" does not make sense in this context.

B. class Man { private BestFriend dog; }

This option is incorrect. Although the variable name "dog" is used, it does not represent the intended relationship. The class BestFriend is not defined anywhere and doesn't make sense in this context.

C. class Man { private Dog bestFriend; }

This option is correct. The class Man has a private variable named "bestFriend" of type Dog, indicating that a Man object has a Dog object as its best friend.

D. class Man implements Dog { }

This option is incorrect. The interface Dog cannot properly represent the relationship between Man and Dog, and implementing the Dog interface does not make sense in this context.

Therefore, the correct answer is:

The Answer is: C. class Man { private Dog bestFriend; }

  1. The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map

  2. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person

  3. Inserting a second Person object into a HashSet will cause the first Person object to be removed as a duplicate.

  4. The time to find the value from HashMap with a Person key depends on the size of the map.


Correct Option: D
  1. varchar is used to store fixed length character data, varchar2 is for variable length character data

  2. varchar data type is not supported in oracle

  3. varchar data type is applicable only to PL/SQL

  4. maximum length for varchar is 2000 bytes and for varchar2 is 4000 bytes


Correct Option: D