Muskan's Mindspace

Welcome to my channel! πŸ’»βœ¨

I’m Muskan Gupta, a passionate B.Tech Graduate on a mission to make programming simple, structured, and accessible for everyone. Whether you are starting from absolute scratch or looking to level up your coding skills, you’ll find easy-to-follow guides here.

As an NPTEL Certified Java programmer with certification from the IIT Bombay CSE department, I love breaking down complex technical concepts into clear, actionable blueprints.

What you’ll find on this channel:

Programming Tutorials: From Java fundamentals to core computer science concepts.

Student Life & Strategy: How to navigate a B.Tech degree, clear certifications, and build a strong foundation.

Roadmaps & Blueprints: Step-by-step paths to mastering languages and coding.

Subscribe to join the journey, and let’s write some great code together! πŸš€


Muskan's Mindspace

## πŸš€ Java Inner Classes β€” Can You Identify All 4?

Java mein **Inner Classes** ek powerful concept hai jo code ko better organize, encapsulate aur maintain karne mein help karta hai. πŸ’»β˜•

In Java, mainly **4 types** ke nested/inner classes hoti hain:

1️⃣ **Static Nested Class**
2️⃣ **Member Inner Class**
3️⃣ **Local Inner Class**
4️⃣ **Anonymous Inner Class**

πŸ€” **Aapko inmein se sabse confusing kaunsi lagti hai?**

Comment mein ** 1, 2, 3, ya 4 ** likho β€” aur batao kyun!

πŸ“Œ Save this post for quick revision.
🎯 Follow/Subscribe for more **Java concepts, coding questions & interview preparation**.

#Java #JavaProgramming #InnerClasses #CoreJava #JavaDeveloper #Coding #Programming #JavaInterview #LearnJava #CodingCommunity

1 day ago | [YT] | 3

Muskan's Mindspace

Topic: Member Inner Class + Static Nested Class + Local Inner Class + Anonymous Inner Class

What will be the output of the following Java code?

class SmartHome {

static class Device {
static String type = "Smart Device";

void showType() {
System.out.println(type);
}
}

String room = "Living Room";

class Sensor {
void check() {
System.out.println(room);
}
}

void activate() {
int level = 5;

class Controller {
void showLevel() {
System.out.println("Level: " + level);
}
}

Controller c = new Controller();
c.showLevel();

Runnable r = new Runnable() {
@Override
public void run() {
System.out.println("System Activated");
}
};

r.run();
}
}

public class Main {
public static void main(String[] args) {

SmartHome home = new SmartHome();

SmartHome.Device device =
new SmartHome.Device();

SmartHome.Sensor sensor =
home.new Sensor();

device.showType();
sensor.check();
home.activate();
}
}

1 day ago | [YT] | 3

Muskan's Mindspace

Can you predict the output?

interface A {
default void display() {
System.out.println("A");
}
}

interface B extends A {
default void display() {
System.out.println("B");
}
}

class C implements B {
}

public class Main {
public static void main(String[] args) {
A obj = new C();
obj.display();
}
}
```

🀯 What will be printed?

πŸ”Ή A) A
πŸ”Ή B) B
πŸ”Ή C) Compilation Error
πŸ”Ή D) Nothing

πŸ”₯ **Don't run the code!**
Try to solve it using your Java OOP knowledge.

πŸ‘‡ Comment your answer + reasoning!

#Java #JavaOOP #JavaInterface #CodingChallenge #Programming

4 days ago | [YT] | 3

Muskan's Mindspace

class Vehicle {
int wheels;

Vehicle() {
this(4);
System.out.println("Vehicle no-arg constructor");
}

Vehicle(int wheels) {
this.wheels = wheels;
System.out.println("Vehicle constructor: wheels = " + wheels);
}
}

class Car extends Vehicle {
String brand;

Car(String brand) {
super(4);
this.brand = brand;
System.out.println("Car constructor: brand = " + brand);
}
}

public class Main {
public static void main(String[] args) {
Car myCar = new Car("Tesla");
System.out.println("Wheels: " + myCar.wheels + ", Brand: " + myCar.brand);
}
}

A)

Vehicle no-arg constructor
Vehicle constructor: wheels = 4
Car constructor: brand = Tesla
Wheels: 4, Brand: Tesla

B)

Vehicle constructor: wheels = 4
Car constructor: brand = Tesla
Wheels: 4, Brand: Tesla

C)

Car constructor: brand = Tesla
Vehicle constructor: wheels = 4
Wheels: 4, Brand: Tesla

D)

Vehicle no-arg constructor
Car constructor: brand = Tesla
Wheels: 4, Brand: Tesla

πŸ’¬ Comment your answer (A, B, C, or D) β€” I'll reveal the correct one and explain why in a reply! πŸ‘‡

5 days ago | [YT] | 4