Earlier I thought I knew OOPS in Java… But while solving output-based questions, I realized the real depth. 🔹 Variables → Compile-time binding (depends on reference) 🔹 Overridden methods → Runtime binding (depends on object) 🔹 Static methods → Compile-time (method hiding) That’s when I understood — Polymorphism is not just theory, it’s about how JVM actually decides what to execute. Now output-based interview questions feel much clearer 💯 Still learning. Still improving. #Java #OOPS #BackendDeveloper #InterviewPreparation #Learning
Java OOPS: Compile-time vs Runtime Binding
More Relevant Posts
-
Revisiting core Java interview concepts often reveals interesting edge cases. Here’s one worth thinking about. What will be the output of the following Java code? class A { static void test() { System.out.println("A"); } } class B extends A { static void test() { System.out.println("B"); } } A a = new B(); a.test(); How would you approach this? Share your reasoning in the comments. #Java #OOPs #Polymorphism #JavaInterview #Coding #Programming #SoftwareTesting
To view or add a comment, sign in
-
Today I Learned: Static vs Non-Static in Java — Order of Execution While revising core Java, I finally got a clear understanding of how the JVM executes static and non-static members. This topic looks simple, but it’s one of the most asked interview concepts! 💡 Key Takeaways: 🔹 Static members belong to the class Static variables load first Static blocks run once when class loads main() starts after static initialization 🔹 Non-static members belong to the object Instance variables load during object creation Non-static blocks run before constructor Constructor initializes the object Instance methods run when called 🔥 Execution Flow Simplified Class Loading → Static Vars → Static Block → main() → Object Creation → Instance Vars → Init Block → Constructor → Methods #Java #JavaProgramming #JavaDeveloper #SoftwareDevelopment #Programming #Coding #BackendDevelopment #TechLearning #Developers #LearnToCode #ProgrammingCommunity #100DaysOfCode #CodeNewbie #TechCareer #SoftwareEngineer
To view or add a comment, sign in
-
-
Entry-level Algorithm Challenge: Array Manipulation in Java. Today I tackled a foundational exercise: reading a list of numbers and filtering out only the negative values. It was a great opportunity to reinforce some core Java concepts: 1. Flow control with do-while loop: Ensuring valid input within a specific range. 2. Simplified iteration with for-each loop: Improving code readability. 3. Handling flags (boolean signals): Providing clear, user-friendly feedback. Check out the logic below! 👇 #Java #Algorithms #SoftwareDevelopment #Coding
To view or add a comment, sign in
-
-
☕ Java Core Concepts – Interview Question 📌 What is Runtime (Dynamic) Polymorphism? In Java, Runtime Polymorphism (also called Dynamic Method Dispatch) is a concept where the method to be executed is determined at runtime, not at compile time. 🔹 Key Points: ✔ Achieved through Method Overriding ✔ Method call is resolved during execution ✔ Depends on the object type, not reference type 🔹 How it Works: • A parent class reference points to a child class object • The overridden method in the child class is executed 🔹 Why it’s Important: ✔ Enables flexibility and extensibility ✔ Supports runtime decision making ✔ Improves code reusability 💡 In Short: Runtime polymorphism allows Java to decide which method to call at runtime, based on the actual object, enabling dynamic behavior in applications. 👉For Java Course Details Visit :https://lnkd.in/gwBnvJPR . #Java #CoreJava #Polymorphism #JavaInterview #Programming #Coding #TechSkills
To view or add a comment, sign in
-
-
🧬 Java Collections – Revision & Practice Yesterday I focused on strengthening my understanding of Java Collections. ✔️ Revised core concepts: • ArrayList • HashMap • Difference between List, Set, and Map Understanding when and where to use each structure makes a big difference while writing efficient code. 💡 Also practiced some basic DSA problems: • Removing duplicates from a list • Finding an element using linear search This combination of concept revision + small problem solving is helping me build stronger fundamentals step by step. 🚀 #Java #Collections #DSA #LearningInPublic #BackendDevelopment #DeveloperJourney
To view or add a comment, sign in
-
🧬 Java Collections – ArrayList Deep Dive Yesterday I explored ArrayList in more detail. ✔️ Looping through elements ✔️ Using methods like remove(), contains(), and size() Understanding these operations helps in managing dynamic data effectively in Java. Also practiced DSA problems like: • Removing even numbers from a list • Finding common elements between two lists Strengthening both collection usage and problem-solving together. 🚀 #Java #Collections #DSA #LearningInPublic #BackendDevelopment #DeveloperJourney
To view or add a comment, sign in
-
Most developers don’t fail because of logic… they fail because of exceptions ⚠️ Your code: ✔ Compiles ✔ Looks correct But then… 💥 Runtime crash. 👉 That’s the difference between: Checked Exceptions (caught early) Unchecked Exceptions (crash later) Custom Exceptions (you define the rules) In this carousel: ✔ Understand compile-time vs runtime errors ✔ Learn when handling is mandatory vs optional ✔ Real examples you’ll face in interviews & real systems 💡 If you’re serious about Java/backend — this is NOT optional knowledge. 👉 Save this — you’ll need it before your next interview. #Java #DSA #Programming #DataStructures #Algorithms #SoftwareEngineering #BackendDevelopment #Developers #CodingTips #InterviewPrep #LearnToCode #DSAwithVisuals
To view or add a comment, sign in
-
🚀 Java Interview Question Series What is the difference between HashMap and ConcurrentHashMap? HashMap: ❌ Not thread safe ❌ Multiple threads can modify data simultaneously ConcurrentHashMap: ✅ Thread safe ✅ Allows concurrent read/write operations Used in multithreaded environments. Many developers fail this simple interview question. Follow me for more Java interview questions and coding tips. 💻 #Java #Programming #CodingInterview #SoftwareDevelopment
To view or add a comment, sign in
-
🔹 Iterator vs for-each Loop in Java Both are used to traverse collections in Java, but they have important differences (very common interview question 🔥). 🔸 1️⃣ Iterator Comes from java.util Works with all Collection types Allows removing elements safely during iteration 🔸 2️⃣ for-each Loop (Enhanced for loop) Introduced in Java 5 Simpler and cleaner syntax Internally uses Iterator Cannot modify collection structure Thankful to my mentor, Anand Kumar Buddarapu, and the practice sessions that continue to strengthen my core Java knowledge. Continuous learning is the key to growth! hashtag #Java #BackendDevelopment #Coding
To view or add a comment, sign in
-
-
#100daysofcodingchallenge - Day14 Question: Write a Java program to read an array of integers and print the minimum and maximum sum of n-1 elements from the array. Input: Enter number of elements: 5 Enter elements: 1 2 3 4 5 Output: Minimum sum of n-1 elements: 10 Maximum sum of n-1 elements: 14 #100daysofcodingchallenge #codingchallenge #day14 #practicecoding #corejava #problemsolving
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development