💻 Java Practice Update | Second Largest Number in Array 📌 Problem: Find the second highest number in an array. 🧠 Approach: Maintain two variables: first and second Traverse the array once Update values based on comparison logic ⚙️ Key Learning: Improves problem-solving skills and helps build strong logic for coding interviews and automation testing scenarios. #Java #Arrays #CodingPractice #SDET #AutomationTesting
Java Array Second Largest Number
More Relevant Posts
-
💻 Java Practice Update | Largest Number in Array 📌 Problem: Find the largest number in an array 🧠 Approach: Assume first element as max Traverse array Compare each element Update max if larger value found ⚙️ Key Learning: Strengthens logic building and is useful in automation testing scenarios like validating UI tables and API responses. #Java #Arrays #CodingPractice #SDET #AutomationTesting interviewchat codeonedigest cod
To view or add a comment, sign in
-
-
💻 Java Practice Update | Largest Number in Array 📌 Problem: Find the largest number in an array 🧠 Approach: Assume first element as max Traverse array Compare each element Update max if larger value found ⚙️ Key Learning: Strengthens logic building and is useful in automation testing scenarios like validating UI tables and API responses. #Java #Arrays #CodingPractice #SDET #AutomationTesting
To view or add a comment, sign in
-
-
💻 Today I practiced a simple but important Java problem reading input until End of File (EOF). The task is to take input line by line and print each line along with its line number. Since we don’t know how many lines the user will enter, we use hasNextLine() inside a loop to keep reading until the input ends. I used a counter starting from 1, read each line using nextLine(), and printed it with the line number. Then I incremented the counter for the next line. This problem looks basic, but it’s very useful in coding platforms like HackerRank where input is not fixed. It also helps in understanding how input streams work in Java. Small problems like this really help in building strong fundamentals. #Java #CodingPractice #InterviewPreparation
To view or add a comment, sign in
-
-
🚀 Day 1 of mastering Java Exception Handling Instead of passively reading, I decided to actively practice like an interview. Here’s what I covered today: ✅ Checked vs Unchecked Exceptions → Compile-time vs Runtime → Why some MUST be handled ✅ try-catch-finally behavior → “finally always executes?” → Not always (System.exit, JVM crash) ✅ throw vs throws → One throws, one declares — simple but often confused ✅ Multiple catch blocks → Ordering matters (specific → general) ✅ Custom Exceptions → Creating meaningful errors instead of generic ones 💡 Biggest realization: Knowing definitions is easy. Explaining them clearly under pressure is the real skill. 🎯 Plan: → Day 2: Deeper concepts + edge cases → Day 3: Tricky output questions (real interview level) #Java #Coding #InterviewPreparation #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
-
Ever wondered what happens internally when a Java class gets loaded? 🤔 When a class is used for the first time, JVM follows a fixed sequence: 1️⃣ Static Variable Initialization 2️⃣ Static Block Execution 3️⃣ Class Becomes Ready And when an object is created: 4️⃣ Instance Variable Initialization 5️⃣ Instance Block Execution 6️⃣ Constructor Execution So the actual flow looks like this: Static Variable → Static Block → Instance Variable → Instance Block → Constructor Important points: Static blocks run only once when the class is loaded Constructors run every time an object is created Static methods can be called without creating an object Non-static methods require an object This is one of the most commonly asked concepts in Java interviews. #Java #JVM #JavaDeveloper #Programming #Coding #SoftwareEngineer #BackendDevelopment #JavaInterview #Developers
To view or add a comment, sign in
-
-
Day 49-What I Learned In a Day (JAVA) Today, I focused on understanding the execution flow of static elements in Java. 🔹 Learned about: • Static variables and how they are shared across objects • Static methods and how they can be accessed without object creation • Static initializer (single-line) • Static initializer (multi-line) This helped me clearly understand how Java handles memory and execution at the class level before objects are created. Building strong fundamentals step by step! #Java #Programming #LearningJourney #OOP #TechSkills
To view or add a comment, sign in
-
-
Day 45-What I Learned In a Day (JAVA) Today I explored some important concepts related to static in Java: 🔹 Static Method Learned how static methods belong to the class and can be called without creating an object. 🔹 Static Initializer (Static Block) Understood how a static block is executed only once when the class is loaded. 🔹 Single-Line Static Initializer Explored how we can initialize static variables in a single line. 🔹 Multi-Line Static Initializer Learned how to use static blocks for complex initialization logic. Practiced 👇 #Java #Programming #LearningJourney #Coding #100DaysOfCode
To view or add a comment, sign in
-
This Java snippet trips up even experienced developers 👇 Integer a = 127; Integer b = 127; Integer c = 128; Integer d = 128; System.out.println(a == b); System.out.println(c == d); One prints true. One prints false. At first glance, both comparisons look identical. Same type. Same assignment. Same operator. So what’s going on? If you know the reason, you’ve got a deeper grasp of how Java actually works under the hood. Drop your explanation below — no Googling 👇 #Java #Programming #SoftwareEngineering #DevCommunity #CodeChallenge
To view or add a comment, sign in
-
Day 37/100 – File Handling & Multithreading in Java ⚙️ Today I explored writing data into files using Java along with a basic understanding of multithreading. I worked on creating a program that writes content into a file using a separate thread, which helps in performing tasks concurrently. Key learnings: • Writing data into files in Java • Basics of multithreading using threads • Executing tasks in a separate thread using start() • Understanding how parallel execution improves performance This gave me a glimpse into how real-world applications handle background tasks efficiently. Learning something new every day and connecting concepts step by step. 🚀 #100DaysOfCode #Java #Multithreading #FileHandling #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
📘 Just shared my Core Java Notes (Collections Framework) I have covered important concepts like: ✔ Arrays vs Collections ✔ List, Set, Map ✔ ArrayList, LinkedList, HashMap, TreeSet ✔ Iterator, Comparator, Comparable ✔ Fail-Fast & Fail-Safe Collections This PDF will help beginners as well as interview preparation 💯 📌 Sharing my notes here — hope it helps someone in their learning journey. #Java #CoreJava #Collections #JavaDeveloper #Programming #InterviewPreparation
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