Godofmercy Web Tech
30/05/2025
*Intermediate Level Java Interview Questions – Part 1*
*1. What is the difference between abstract class and interface?*
Abstract class: Can have both abstract (no body) and non-abstract methods. Can have constructors and instance variables.
Interface: All methods are abstract (until Java 7), only static/final variables.
> Example:
abstract class Animal {
abstract void makeSound();
void breathe() { System.out.println("Breathing"); }
}
interface Flyable {
void fly();
}
*2. What is this vs super in Java?*
this: Refers to current class
super: Refers to parent class
> Example:
class Parent {
int x = 10;
}
class Child extends Parent {
int x = 20;
void print() {
System.out.println(this.x); // 20
System.out.println(super.x); // 10
}
}
*3. What is exception handling in Java?*
It’s how Java handles runtime errors using try, catch, finally, and throw.
> Example:
try {
int a = 5 / 0;
} catch (ArithmeticException e) {
System.out.println("Cannot divide by zero");
} finally {
System.out.println("Cleanup done");
}
*4. What is method overriding vs overloading?*
Overloading: Same method name, different parameters (compile-time polymorphism)
Overriding: Redefining parent class method in child (runtime polymorphism)
> Overriding Example:
class Animal {
void sound() { System.out.println("Animal sound"); }
}
class Dog extends Animal {
void sound() { System.out.println("Dog barks"); }
}
*5. What is the finalize() method?*
It's called by the garbage collector before an object is destroyed — rarely used now.
> Example:
protected void finalize() throws Throwable {
System.out.println("Object is being garbage collected");
}
*React ❤️ for Part-2*
UNLOCK YOUR DIGITAL POTENTIAL TODAY WITH YOUR SMART PHONE 🤳📱
ITS SIMPLE
IT'S WHAT YOU CAN DO
EARN EVEN AS AT HOME 🏠
😂 My 📸 i did 2yrs ago
Awesome Digital Workshop
08/05/2025
As part of the CivicConnect Hackathon, the Design Thinking Masterclass is a critical pre-event session to equip participants with the mindset and methodology to build impactful, user-centered solutions.
By teaching teams how to identify real civic problems, empathize with users, and iterate rapidly. The aim is to shape thoughtful, scalable solutions that the state can adopt with confidence.
This session ensures higher-quality outputs from participants.
Date: Saturday, May 10, 2025.
Venue: Softicu Hub, Umuahia
Time: 11AM
If you are yet to register your team, do so here now
https://forms.office.com/r/0tRt6rZaTK
Let’s hack solutions that power real impact.
Click here to claim your Sponsored Listing.
Category
Contact the business
Telephone
Website
Address
Abuja