Islami Bank Bangladesh Limited — Officer (Software Engineer) — Written Test: 2019প্রশ্ন ও সমাধান
- Set by
- Islami Bank
- Post
- Officer
- Exam date
- 2019
- Questions
- 9 (0 MCQ, 9 written)
- Exam guide
- Bank IT jobs · ব্যাংকের আইটি চাকরি
- Programming · প্রোগ্রামিং 8
- Database · ডেটাবেজ 1
What are the difference among JDK, JRE and JVM?
Model answer
JDK, JRE and JVM are three closely related but distinct components of the Java platform, each nested inside the next.
graph TD
JDK["JDK (Java Development Kit)"] --> JRE["JRE (Java Runtime Environment)"]
JRE --> JVM["JVM (Java Virtual Machine)"]
| Aspect | JDK | JRE | JVM |
|---|---|---|---|
| Full form | Java Development Kit | Java Runtime Environment | Java Virtual Machine |
| Purpose | Complete kit to develop, compile and run Java programs | Provides everything needed to run compiled Java programs | The engine that executes Java bytecode |
| Contains | JRE + compiler (javac), debugger, other dev tools |
JVM + class libraries + supporting files | Class loader, bytecode verifier, execution engine (interpreter/JIT) |
| Platform dependency | Platform-dependent (separate download per OS) | Platform-dependent | Platform-independent specification, but implementation is platform-specific |
| Relationship | Superset — contains JRE | Subset of JDK, superset of JVM | Subset of JRE |
| Who uses it | Programmers/developers | End users who only run Java apps | Runs "inside" JRE, invisible to the user |
| Example need | Writing and compiling a .java file |
Running a .jar file with no source code |
Interpreting .class bytecode line by line |
How they fit together: a developer writes source code and uses the JDK's javac to compile it into bytecode (.class files). To actually run that bytecode, the JRE (which bundles the JVM and standard libraries) is required. The JVM is the innermost component — it loads, verifies and executes the bytecode instruction by instruction (or via Just-In-Time compilation for speed).
Exam takeaway: JDK ⊃ JRE ⊃ JVM — "JDK to build, JRE to run, JVM to execute." A machine that only needs to run Java apps needs just the JRE; a machine used to write and compile Java code needs the full JDK.
How many types of memory areas are allocated by JVM?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is the output of the following Java program?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is constructor? How many types of constructors are used in Java?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is the output of the following Java program?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is static method? What are the restrictions that are applied to the Java static Methods?
Model answer
A static method belongs to the class itself, not to any individual object. It can therefore be called directly using the class name (ClassName.methodName()), without creating an object — it is loaded into memory once, at class-loading time, and shared by all instances.
class MathUtil {
public static int square(int n) { // static method
return n * n;
}
}
public class Test {
public static void main(String[] args) {
System.out.println(MathUtil.square(5)); // called without an object
}
}
Output: 25
Restrictions on static methods:
- Cannot directly access non-static (instance) members. A static method runs before any object may exist, so it has no implicit reference to instance data/methods — it can only touch other static members directly (a non-static member can still be reached indirectly through an explicit object reference).
- Cannot use
thisorsuper. Both keywords refer to the current object instance, which a static context does not have. - Cannot be overridden in the usual polymorphic sense — a static method in a subclass with the same signature merely hides the parent's version (resolved at compile time based on reference type), it does not participate in dynamic dispatch.
Demonstration of restriction 1:
class A {
int a = 40; // non-static (instance) field
public static void main(String[] args) {
System.out.println(a); // ERROR: cannot reference instance field statically
}
}
Output: Compile-time error — "non-static variable a cannot be referenced from a static context"
Fix: either make a static (static int a = 40;), or access it through an object: new A().a.
Exam takeaway: static = belongs to the class, exists without any object, cannot see instance data/this/super directly, and is resolved at compile time rather than run time.
What is this keyword in Java? What are the main uses of this keyword?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is the Inheritance? What are the types of Inheritance in Java?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Write down five differences between DELETE and TRUNCATE statement in SQL?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers · Bank IT jobs guide