Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Author name: admin

During suction stroke, the inside pressure of cylinder is

Question: During suction stroke, the inside pressure of cylinder is
[A].

more than the atmospheric pressure

[B].

less than the atmospheric pressure

[C].

equal to the atmospheric pressure

[D].

none of these

Answer: Option B

Explanation:

No answer description available for this question.

During suction stroke, the inside pressure of cylinder is Read More »

Automobile Engineering, Mechanical Engineering

In Diesel engines, during suction stroke, __________ is drawn in the cylinder.

Question: In Diesel engines, during suction stroke, __________ is drawn in the cylinder.
[A].

air and fuel

[B].

only fuel

[C].

only air

[D].

none of these

Answer: Option C

Explanation:

No answer description available for this question.

In Diesel engines, during suction stroke, __________ is drawn in the cylinder. Read More »

Automobile Engineering, Mechanical Engineering

You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?

Question: You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?
[A].

public

[B].

private

[C].

protected

[D].

default access

Answer: Option D

Explanation:

The only two real contenders are C and D. Protected access Option C makes a member accessible only to classes in the same package or subclass of the class. While default access Option D makes a member accessible only to classes in the same package.

You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective? Read More »

Declarations And Access Control, Java Programming

In petrol engines, during suction stroke, __________ is drawn in the cylinder

Question: In petrol engines, during suction stroke, __________ is drawn in the cylinder
[A].

air and fuel

[B].

only fuel

[C].

only air

[D].

none of these

Answer: Option A

Explanation:

No answer description available for this question.

In petrol engines, during suction stroke, __________ is drawn in the cylinder Read More »

Automobile Engineering, Mechanical Engineering

In a four stroke engine for each crankshaft revolution, the camshaft revolves

Question: In a four stroke engine for each crankshaft revolution, the camshaft revolves
[A].

one-half turn

[B].

one turn

[C].

two turns

[D].

four turns

Answer: Option A

Explanation:

No answer description available for this question.

In a four stroke engine for each crankshaft revolution, the camshaft revolves Read More »

Automobile Engineering, Mechanical Engineering

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

Question: You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
[A].

public

[B].

private

[C].

protected

[D].

transient

Answer: Option C

Explanation:

Access modifiers dictate which classes, not which instances, may access features.

Methods and variables are collectively known as members. Method and variable members are given access control in exactly the same way.

private makes a member accessible only from within its own class

protected makes a member accessible only to classes in the same package or subclass of the class

default access is very similar to protected (make sure you spot the difference) default access makes a member accessible only to classes in the same package.

public means that all other classes regardless of the package that they belong to, can access the member (assuming the class itself is visible)

final makes it impossible to extend a class, when applied to a method it prevents a method from being overridden in a subclass, when applied to a variable it makes it impossible to reinitialise a variable once it has been initialised

abstract declares a method that has not been implemented.

transient indicates that a variable is not part of the persistent state of an object.

volatile indicates that a thread must reconcile its working copy of the field with the master copy every time it accesses the variable.

After examining the above it should be obvious that the access modifier that provides the most restrictions for methods to be accessed from the subclasses of the class from another package is C – protected. A is also a contender but C is more restrictive, B would be the answer if the constraint was the “same package” instead of “any package” in other words the subclasses clause in the question eliminates default.

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective? Read More »

Declarations And Access Control, Java Programming