🔹 Title: Solving “Plus Minus” Problem in Java 📊 🔹 Description: Today I solved the Plus Minus problem, where the goal is to calculate the ratios of positive, negative, and zero values in an array. The challenge was not just counting the values, but also formatting the output correctly to 6 decimal places. 💡 Approach: Traverse the array and count positives, negatives, and zeros Divide each count by the total number of elements Print results using precise formatting 🔹 What I learned: ✔ Importance of output formatting ✔ Handling edge cases (like zeros) ✔ Writing clean and efficient Java code Consistency in practicing such problems really strengthens core programming skills. 🚀 #Java #Coding #ProblemSolving #Programming #DataStructures
Solving Plus Minus Problem in Java
More Relevant Posts
-
Today I explored some fundamental yet powerful concepts in Java that every developer should have a strong grip on: 🔹 Static Methods & VariablesUnderstanding how static members are shared across all objects really changed how I think about memory and efficiency. It’s amazing how a simple static keyword can help track object creation and maintain shared data seamlessly. 🔹 Constructor Overloading & this KeywordThis concept made object initialization much more flexible. Using multiple constructors and the this keyword not only improves code readability but also avoids redundancy. 💡 What I realized:Strong basics are the real game-changer. These concepts might look simple, but they build the foundation for writing clean, scalable, and efficient code. 📌 Consistency in learning > Complexity in topics I’m currently focusing on strengthening my core Java skills and building projects around them. Every small concept learned today contributes to becoming a better developer tomorrow. #Java #Programming #CodingJourney #DeveloperLife #JavaDeveloper #Learning #TechSkills #Coding #StudentDeveloper
To view or add a comment, sign in
-
Strings are one of the most fundamental yet powerful components in Java, and understanding how they actually work can make a significant difference in writing efficient, reliable, and scalable applications. This guide breaks down key concepts such as how Strings are stored in memory (String Constant Pool vs Heap), why immutability is a core design decision, and how different comparison methods like ==, .equals(), .equalsIgnoreCase(), and .compareTo() behave in real scenarios. These are not just theoretical ideas they directly impact performance, memory optimization, and correctness of code. It also highlights the practical side of working with Strings, including commonly used methods and when to use mutable alternatives like StringBuilder or StringBuffer for better performance in specific use cases. #Java #SoftwareDevelopment #Programming #Coding #JavaDeveloper #TechSkills #BackendDevelopment #ComputerScience #TapAcademy
To view or add a comment, sign in
-
-
🔹 What is a Constructor in Java? A constructor is a special method that is used to initialize objects in a class. 👉 It is called automatically when an object is created. A constructor helps to give values to an object at the time of creation. Example: class Student { int id; String name; Student(int i, String n) { id = i; name = n; } } ✔ When we create an object: Student s1 = new Student(101, "John"); 🚀 Types of Constructors: ✔ Default Constructor – No parameters ✔ Parameterized Constructor – With parameters ✔ Copy Constructor – Copy values from another object 🚀 Why use Constructor? - To initialize object values - To reduce extra code - Makes object creation easy #FortuneaCloudeTechnology #Java #Constructor #OOP #Programming #Coding
To view or add a comment, sign in
-
-
Reversed String in Java | Easy Logic + Coding 💡 Strong fundamentals are essential to become a confident developer. This example shows how String Reversal works using simple logic: • Start with a given string • Traverse the string from last character to first • Use loop or built-in methods • Form the reversed string Practicing these types of problems improves logical thinking and strengthens coding basics. 📊 Example Input : LIVE Output : EVIL 🎥 I’ve also created a short video explaining this concept with code: YouTube link : https://lnkd.in/eKH2JJwa #Java #Programming #ProblemSolving #Coding #SoftwareDevelopment #Learning #CSE #Developers #LogicBuilding #String
To view or add a comment, sign in
-
-
🚀 New YouTube Video Alert! I just uploaded a new video where I practice Java loops by building a Multiplication Table Exercise 🧮 In this tutorial, I explain and demonstrate how to use: 🔹 "for" loop 🔹 "while" loop We go step by step to understand how iteration works in Java and how loops can simplify repetitive tasks. 💡 This exercise is perfect for beginners who want to strengthen their logic and improve their programming skills. 📺 Watch the full video here: [https://lnkd.in/dPqCz2h8] Let’s keep learning and building strong programming fundamentals together 💻🔥 #Java #Programming #Loops #Coding #YouTube #SoftwareDevelopment #LearnToCode
multiplication table in java using for and while loop
https://www.youtube.com/
To view or add a comment, sign in
-
Day 10/100 – Java Practice Challenge 🚀 Continuing my #100DaysOfCode journey with another important Java concept. 🔹 Topic Covered: Polymorphism Polymorphism means “many forms” — the same method behaves differently depending on the object. 💻 Practice Code: 🔸 Example Program class Animal { void sound() { System.out.println("Animal makes sound"); } } class Dog extends Animal { @Override void sound() { System.out.println("Dog barks"); } } public class Main { public static void main(String[] args) { Animal a = new Dog(); // Upcasting a.sound(); // Runtime polymorphism } } 📌 Key Learnings: ✔️ Same method → different behavior ✔️ Achieved using method overriding ✔️ Based on object type (runtime) 🎯 Focus: Understanding dynamic behavior using inheritance and method overriding 🔥 Interview Insight: Polymorphism is a core OOP concept and widely used in real-world applications. #Java #100DaysOfCode #Polymorphism #OOP #JavaDeveloper #Programming #LearningInPublic
To view or add a comment, sign in
-
Mini-Max Sum Problem Solved in Java 🚀 | Efficient Coding Approach Today I solved the classic Mini-Max Sum problem using Java! 💻 📌 Problem Statement: Given 5 positive integers, find the minimum and maximum values by summing exactly 4 out of the 5 numbers. 📌 Approach: Instead of sorting, I used an optimized method: Calculate total sum Subtract the maximum value → gives minimum sum Subtract the minimum value → gives maximum sum 📌 Why this approach? Time Complexity: O(n) #Java #Coding #Programming #ProblemSolving #DataStructures More efficient than sorting (O(n log n))
To view or add a comment, sign in
-
-
Understanding the difference between shallow copy and deep copy in Java really changed how I think about object handling and memory. A shallow copy duplicates the reference — meaning changes in one object can unexpectedly affect another. On the other hand, a deep copy creates an entirely independent object with its own memory allocation. This concept might seem small at first, but it becomes critical when working with complex data structures, real-world applications, and avoiding unintended side effects. Key takeaway: Always be clear whether you're copying data or just references. #Java #Programming #Learning #DSA #SoftwareDevelopment
To view or add a comment, sign in
-
-
📘 Revised Logic Building in Java with @LetsUpgrade (Day 2) Attended Day 2 of the Java Bootcamp, which focused on strengthening problem-solving and logic building skills. 🔹 Topics revised: • Conditional Statements (if, else, else-if) • Loops (for, while) • Arrays • Strings and basic functions 💻 Practice: Worked on basic problems and received homework to improve coding skills Revisiting these concepts is really helping me improve my logic and confidence in Java. Looking forward to learning more! #LetsUpgrade #Java #Programming #Coding #JavaBasics #LogicBuilding #LearningJourney #DeveloperJourney
To view or add a comment, sign in
-
-
Most developers start with Java by writing code but the real clarity comes when you understand what is happening underneath Swipe through this This is how I started looking at Java beyond just syntax In the beginning I focused on writing programs that work loops classes functions done but things started making more sense when I looked deeper how JVM actually executes code why OOP is more than just theory how memory is managed through stack and heap what really happens in collections and multithreading and why garbage collection matters more than we think The more I learn, the more I realise strong fundamentals make everything else easier frameworks tools and systems all build on this Still learning and going deeper into core concepts What part of core Java took you the most time to understand #Java #CoreJava #BackendDevelopment #SoftwareEngineering #Programming #JavaDeveloper
To view or add a comment, sign in
-
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