Today task....userlogin ~ using encapsulation with abstraction class and methods. ~ also using inheritance to access the variables. ~ encapsulation is protect the data from user, this using the keyword like private that can't be accessed outside class ,so use set and get method for access and update the variables . #encapsulation #javaprogram #java #programmer #codding
How to use encapsulation and inheritance in Java
More Relevant Posts
-
📝 COMMENTS IN THE MIDDLE? TIME TO REFACTOR. If you need a comment to explain a chunk of logic inside a method, that logic probably deserves its own name. 👉 “Mid-method comments are a smell—extract a clearly named private method.” Name the intent, not the mechanics. Small, well-named methods read like a story and make bugs easier to spot. ✅ #CleanCode #Refactoring #Readability #SoftwareCraftsmanship #CodeQuality #DeveloperTips #Programming #Java
To view or add a comment, sign in
-
-
Day 43 of #50DaysOfLeetCodeChallenge Problem: Valid Parentheses Approach: Used a stack to keep track of opening brackets. For each closing bracket, checked if it matches the top of the stack. Returned false if there was a mismatch or stack was empty. This ensures all brackets are properly nested and closed. Key Takeaways: Stacks are perfect for problems involving nested structures. Simple traversal with O(n) time complexity and O(n) space. Feeling more confident handling pointers and references in Java! Performance: Using a stack this way really helped me understand how to manage nested elements efficiently. #LeetCode #Java #DSA #CodingChallenge #ProblemSolving #Stack #Programming
To view or add a comment, sign in
-
-
Day 6 of #50DaysOfCode – Java Today I practiced arrays and loops by writing a program to take 5 numbers from the user and calculate their sum and average. 💻 What I did: Stored numbers in an array Calculated the sum using a for loop Calculated the average and displayed the results 🧠 Concepts learned: Arrays (int[]) Loops (for) Arithmetic operations (+, /) Input/output using Scanner Excited to keep learning step by step! 💪 #Java #LearnInPublic #CodingJourney #50DaysOfCode #Programming
To view or add a comment, sign in
-
Day 47 of #100DaysOfLeetCode Today's problem: Reverse Words in a String Language used: Java What I did today: I implemented a solution to reverse the order of words in a given string while handling extra spaces efficiently. Used split("\\s+") to handle multiple spaces. Reconstructed the reversed string using StringBuilder. Applied trim() to clean up leading and trailing spaces. Key Takeaways: split("\\s+") is great for ignoring multiple spaces. Always use trim() to ensure a neat final output. StringBuilder makes string manipulation much faster than direct concatenation. #100DaysOfCode #LeetCode #Java #CodingChallenge #ProblemSolving #Programming #DeveloperJourney #LearnToCode
To view or add a comment, sign in
-
-
Hierarchical Inheritance in Java In Hierarchical Inheritance, multiple child classes inherit from a single parent class. Here, class A represents a base class, and classes B and C extend it — each providing their own implementation of the car() method with different colors. This example demonstrates how inheritance promotes code reusability and method overriding in object-oriented programming. #Java #OOPs #Inheritance #Learning #10000Coders #Coding #SoftwareDevelopment
To view or add a comment, sign in
-
-
Day 21 of #50DaysOfCode – Java Today’s challenge was Printing All Prime Numbers Between 1 and N. This task helped me understand how to identify prime numbers and how nested loops work in Java. Key learnings from today: 🔹 A prime number is divisible only by 1 and itself 🔹 We can check primality by testing divisibility 🔹 Using logical conditions and loops together improves problem-solving Slowly building confidence with new concepts every day! 💪✨ #Java #CodingJourney #50DaysOfCode #PrimeNumbers #LogicBuilding #ProgrammingBasics #LearningEveryday
To view or add a comment, sign in
-
🔥 Day 7 of Java Learning Series 🔥 Topic: 🧩 StringBuffer vs StringBuilder 🔹 StringBuffer (Java) Definition: A mutable sequence of characters that allows modification of strings without creating new objects. ✅ Thread-safe (synchronized), best for multi-threaded environments. 🔹 StringBuilder (Java) Definition: A mutable sequence of characters that allows modification of strings without creating new objects. ⚡ Not thread-safe, but faster, ideal for single-threaded environments. 🧠 Summary: Both allow efficient string manipulation, but choose based on thread safety vs performance. 10000 Coders #Day7 #Java #100DaysOfCode #Programming #StringBuilder #StringBuffer #JavaLearning #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 140 of #150DaysOfCode on LeetCode Solved: 1526. Minimum Number of Increments on Subarrays to Form a Target Array Language: Java The task was to determine the minimum number of subarray increment operations needed to build the target array from all zeros. 🔹 Intuition: Every time the current element is greater than the previous one, it means we need that many new operations to reach the next level. Decreases don’t add extra work since earlier increments already cover them. 🔹 Approach: Start with the first element’s value as the initial count. For each subsequent element, if it’s larger than the previous one, add the difference. The sum of all such differences gives the minimum number of operations required. 🔹 Complexity: Time: O(n) Space: O(1) #LeetCode #150DaysOfCode #Java #CodingChallenge #ProblemSolving #Greedy #Arrays #DSA #TechLearning #Programmer #WomenInTech #CodeJourney #DynamicProgramming
To view or add a comment, sign in
-
-
Andrea Bergia has written a Java Virtual Machine (JVM) in Rust! The initial effort was about two years ago, and the series of blog posts is fascinating. The initial blog post: https://lnkd.in/ep5RAcf6 The entire list of posts on rjvm: https://lnkd.in/gGKRp8zi #jvm #programming #runtimes #languages
To view or add a comment, sign in
-
🚀 Day 129/160 – Total Decoding Messages | Dynamic Programming Today’s challenge was about decoding numeric messages into alphabets (like 1→A, 2→B...26→Z). Used a DP approach to count all valid decoding ways efficiently. 🧠 Key takeaway: Dynamic Programming shines when a problem’s state depends on previous results — here, each position depends on the previous one and the one before it. #100DaysOfCode #GeeksforGeeks #160DaysOfDSA #DynamicProgramming #ProblemSolving #Java #CodingJourney #LearnByDoing
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