Tag: programming languages

Questions Related to programming languages

Given: 10. public class Fabric 11. public enum Color { 12. RED(0xff0000), GREEN(0x00ff00), BLUE(0x0000ff); 13. private final int rgb; 14. Color( int rgb) { this.rgb = rgb; } 15. public int getRGB() { return rgb; } 16. }; 17. public static void main( String[] argv) { 18. // insert code here 19. } 20. } Which two code fragments, inserted independently at line 18, allow the Fabric class to compile? (Choose two.)

  1. Color skyColor = BLUE;

  2. Color treeColor = Color.GREEN;

  3. Color purple = new Color( 0xff00ff);

  4. if( RED.getRGB() < BLUE.getRGB() ) {}

  5. Color purple = Color.BLUE + Color.RED;

  6. if( Color.RED.ordinal() < Color.BLUE.ordinal() ) {}


Correct Option: B,F

AI Explanation

To answer this question, let's review each of the given options:

Option A) Color skyColor = BLUE; This option assigns the enum constant "BLUE" to the variable "skyColor". This is incorrect because "BLUE" is a member of the "Color" enum and should be accessed as "Color.BLUE".

Option B) Color treeColor = Color.GREEN; This option correctly assigns the enum constant "GREEN" from the "Color" enum to the variable "treeColor". This is a valid way to access enum constants.

Option C) Color purple = new Color(0xff00ff); This option attempts to create a new enum constant using the constructor of the "Color" enum. However, enum constants are predefined and cannot be created using the constructor. This is incorrect.

Option D) if (RED.getRGB() < BLUE.getRGB()) {} This option correctly accesses the "getRGB()" method of the "RED" and "BLUE" enum constants and performs a comparison. This is a valid way to access enum constants and their methods.

Option E) Color purple = Color.BLUE + Color.RED; This option attempts to add the enum constants "BLUE" and "RED". However, enum constants cannot be added together using the "+" operator. This is incorrect.

Option F) if (Color.RED.ordinal() < Color.BLUE.ordinal()) {} This option correctly accesses the "ordinal()" method of the "RED" and "BLUE" enum constants and performs a comparison. This is a valid way to access enum constants and their methods.

Therefore, the correct options are B) Color treeColor = Color.GREEN; and F) if (Color.RED.ordinal() < Color.BLUE.ordinal()).

What are the views available in the Workflow Monitor

  1. Task View and Gnatt Chart View

  2. Task View, Time View and Workflow View

  3. Task View, Gnatt Chart View and workflow view

  4. Gnatt View and Workflow view


Correct Option: A

Repository Manager is used to

  1. Create user

  2. Create folders

  3. Assign privileges

  4. All of the above


Correct Option: D

Which of the following are Informatica PowerCenter Server Components

  1. Informatica Server

  2. Repository Server

  3. Both A and B

  4. Neither A nor B


Correct Option: C
  1. Tasks must be within Workflows in order to be executed

  2. Workflows must be within Tasks to be executed

  3. Workflow links may contain conditions

  4. A start task is default task in a Workflow


Correct Option: B

What types of data source(s) can be read with the source qualifier transformation?

  1. Relational Databases

  2. Relational Databases and flat files

  3. Relational Databases,lat files and cobol

  4. Relational Databases,lat files,cobol and certified ERP sources such as Peoplesoft and SAP R/3


Correct Option: D
  1. Run the Debugger, validate mappings and mapplets, import source definitions

  2. Run the debugger, create and delete folders, import source definitions

  3. Create and delete folders, view object dependencies, import source definitions

  4. Create and delete folders, create and edit mappings, create target tables


Correct Option: A

Which of the following is not a character function

  1. LTRIM

  2. SUBSTR

  3. CONCAT

  4. TRUNC


Correct Option: D

Which of the following is not a task in Workflow Manager

  1. Email

  2. Session

  3. Workflow

  4. Timer


Correct Option: C