Tag: technology

Questions Related to technology

  1. Nimda

  2. Fatal Connections

  3. RHS

  4. Slapper


Correct Option: C
  1. NeuroticKat

  2. T0rn Rootkit

  3. Slapper

  4. SweetHeart


Correct Option: C
  1. Masters Paradise

  2. Amanda

  3. Chode

  4. SubSARI


Correct Option: C
  1. Rother J

  2. Creeper

  3. Wabbit virus

  4. Elk Cloner


Correct Option: B
  1. Shape s = new Shape(); s.setAnchor(10,10); s.draw();

  2. Circle c = new Shape(); c.setAnchor(10,10); c.draw();

  3. Shape s = new Circle(); s.setAnchor(10,10); s.draw();

  4. Shape s = new Circle(); s->setAnchor(10,10); s->draw();


Correct Option: C
  1. A. double getSalesAmount() { return 1230.45; }

  2. B. public double getSalesAmount() { return 1230.45; }

  3. C. private double getSalesAmount() { return 1230.45; }

  4. D. protected double getSalesAmount() { return 1230.45; }


Correct Option: B,D
Explanation:

Explanation: To answer this question, we need to understand the concept of abstract classes and abstract methods in Java.

An abstract class is a class that cannot be instantiated on its own and must be subclassed. An abstract method is a method that is declared but does not have an implementation in the abstract class. Any subclass of the abstract class must provide an implementation for the abstract method.

In this code, the Employee class is an abstract class that has an abstract method named getSalesAmount(). The Sales class is a subclass of the Employee class and must provide an implementation for the getSalesAmount() method.

Option A) double getSalesAmount() { return 1230.45; } - This option is incorrect because the method needs to be declared as protected or public to provide implementation for the abstract method in the parent class.

Option B) public double getSalesAmount() { return 1230.45; } - This option is correct because it provides a public implementation for the abstract method in the parent class.

Option C) private double getSalesAmount() { return 1230.45; } - This option is incorrect because a private method cannot override a method in the parent class.

Option D) protected double getSalesAmount() { return 1230.45; } - This option is correct because it provides a protected implementation for the abstract method in the parent class.

Therefore, options B and D are the correct answers.

  1. . public class Employee extends Info implements Data { public void load() { /do something/ }

  2. public class Employee implements Info extends Data { public void load() { /do something/ }

  3. public class Employee extends Info implements Data { public void load() { /*do something */ }

  4. public class Employee implements Info extends Data { public void Data.load() { /*d something */ }


Correct Option: A
Explanation:

To solve this question, the user needs to understand the difference between an interface and an abstract class in Java. An interface is a contract that specifies a set of methods that a class must implement, while an abstract class can contain both abstract and non-abstract methods and serves as a base class for other classes to inherit from.

Option A is correct because it correctly uses the Data interface and Info class. The Employee class extends the abstract Info class and implements the Data interface, thus fulfilling the requirements of both. The load() method in Employee must be implemented because it is declared in both the Data interface and the Info abstract class.

Option B is incorrect because the order of the interface and extends keywords is wrong. It should be "implements Info extends Data", not "extends Data implements Info". Additionally, the load() method must be implemented because it is declared in both the Data interface and the Info abstract class.

Option C is correct because it correctly uses the Data interface and Info class. The Employee class extends the abstract Info class and implements the Data interface, thus fulfilling the requirements of both. The load() method in Employee must be implemented because it is declared in both the Data interface and the Info abstract class.

Option D is incorrect because it attempts to implement the load() method by prefixing it with the Data interface name, which is not valid syntax. The correct way to implement the load() method is to define it without any prefix, as in options A and C.

Therefore, the correct answer is:

The Answer is: A. public class Employee extends Info implements Data { public void load() { /do something/ }

  1. Read one record from INDD and store in in SRCLINE stack.

  2. Read all the records from INDD and store in in SRCLINE stack.

  3. Write one record from INDD and store in in SRCLINE stack.

  4. Write all the records from INDD and store in in SRCLINE stack.


Correct Option: B