Questions Related to softskills
-
12
-
nothing
-
compilation error
-
0
C
Correct answer
Explanation
The code contains several errors: 'NowString()' is a constructor name that doesn't match the class 'NowS', and 'Super.Sam(12)' is invalid syntax for calling a superclass constructor (it should be 'super(12)'). These issues cause a compilation error.
-
Import new package
-
use concrete class
-
Use of Interfaces
-
Use Inheritance
C
Correct answer
Explanation
Java does not support multiple inheritance of classes to avoid complexity and the 'diamond problem'. However, it allows a class to implement multiple interfaces, effectively providing a way to achieve the benefits of multiple inheritance.
A
Correct answer
Explanation
An interface in Java is 100% abstract - it can only contain abstract method declarations (and constants). Unlike abstract classes which can have both abstract and concrete methods, interfaces cannot have any implemented methods. This is the fundamental definition of an interface in Java - it provides a contract without implementation.
-
static variable
-
Abstract method
-
Initializer Block
-
Instance variables
A,C
Correct answer
Explanation
In Java, static variables are initialized when the class is loaded, and initializer blocks (both static and instance) run before the constructor body. Static blocks run once at load time; instance blocks run every time an object is created, just before the constructor.
-
constructor
-
public instance variable
-
protected members
-
Primitive elements
A
Correct answer
Explanation
Constructors are not inherited in Java - each class must have its own constructors. When a subclass is instantiated, it calls the superclass constructor (implicitly or explicitly via super()), but it does not inherit the constructor itself. Public instance variables, protected members, and primitive elements are all inherited by subclasses.
-
Run-time Error
-
True
-
Compilation Error
-
False
B
Correct answer
Explanation
The code uses assignment (=) instead of equality (). In 'if(var = true)', the assignment happens first (var becomes true), then the condition evaluates the assigned value. Since true is truthy, the if-block executes, printing 'TRUE'. This is a common bug - the programmer likely meant to compare () but accidentally assigned. There's no compilation or runtime error - Java allows boolean assignment in conditions.
-
Barathrum
-
Balanar
-
Nevermore
-
Nerubian Weaver
B
Correct answer
Explanation
Balanar the Night Stalker is a hero in DotA whose abilities are specifically designed for nighttime combat - he has increased movement speed, attack speed, and vision at night. This makes him extremely dangerous to encounter during night hours. Barathrum, Nevermore, and Nerubian Weaver don't have this specific night-based dominance that would make them particularly threatening at night.
B
Correct answer
Explanation
In a 1v1 match, Bradwarden the Centaur Warchief would likely beat Sand King due to his durability. Centaur has high strength gain, Return (damage reflection), and great survivability with spells like Blade Mail and Hoof Stomp. Sand King relies on Burrowstrike and Epicenter, but in a 1v1, Centaur's tankiness and damage reflection would give him the advantage. The statement is false.
-
Slardar
-
Balanar
-
Ezalor
-
DarkSeer
C
Correct answer
Explanation
In the context of Dota, Slardar, Balanar (Night Stalker), and Dark Seer have abilities (Sprint, Hunter in the Night, Surge) that allow them to reach the maximum movement speed cap of 522. Ezalor (Keeper of the Light) does not have a self-buff to reach this cap.
-
Ablutophobia
-
Agateophobia
-
Aeroacrophobia
-
Ailurophobia
A
Correct answer
Explanation
Ablutophobia is the specific phobia relating to washing, bathing, or cleaning. The term comes from the Latin 'abluere' (to wash) and 'phobia' (fear). People with this condition experience intense anxiety about washing or bathing, which can significantly impact daily hygiene and quality of life.