Day 8.... 💡 Today I Learned: Pass by Value vs Pass by Reference in Java While exploring Java, I learned how data is passed between variables and methods — and it finally made sense! 😄 ✨ Pass by Value: Java copies only the value of a variable, not the original one. So, changes made to the new variable don’t affect the original. 🚗 Pass by Reference: When it comes to objects, both variables can refer to the same memory address. So, updating one will reflect in the other. 🧠 In short: 🔹 Primitives → Pass by Value (independent copies) 🔹 Objects → Pass by Reference (shared memory) Learning this helped me clearly understand how Java handles data in memory! 🚀 #Java #TapAcademy #CodingJourney #LearningInPublic #JavaConcepts
Java Pass by Value vs Pass by Reference Explained
More Relevant Posts
-
🚀Day 4(Part 2)|Core Java learning journey ☕ Today I explored one of the most important basics of Java — Variables. Understanding variable types helps in writing clean, efficient, and bug-free code. 🔹 Local Variable Declared inside a method/block. Accessible only within that block. 🔹 Instance Variable Declared inside a class but outside methods. Each object gets its own copy. 🔹 Static Variable Declared using static keyword. Shared among all objects of the class. 🔹 Global Variable In Java, there is no direct concept of global variables. Class-level (static/instance) variables are used instead. 🔹 Constant Variable Declared using final keyword. Value cannot be changed once assigned. #CoreJava #JavaBasics #LearningJava #JavaDeveloper #FortuneCloud
To view or add a comment, sign in
-
-
Day 10 – Learning Java Full Stack Today let's learn about While Loop. The while loop is used when we want to execute a block of code repeatedly as long as a condition is true. Syntax: while (condition) { // loop body } The loop keeps running until the condition becomes false. Example: int a = 1; while (a <= 5) { System.out.println("JAVA"); a++; } Execution Flow: When a = 1 → JAVA When a = 2 → JAVA When a = 3 → JAVA When a = 4 → JAVA When a = 5 → JAVA When a = 6 → Condition becomes false → Loop terminates Key takeaway: A while loop is condition-based repetition. If the condition never becomes false, it can lead to an infinite loop — so updating the variable is very important. More learning updates coming soon #Java #JavaFullStack #WhileLoop #ControlStatements #LearningInPublic #CoreJava
To view or add a comment, sign in
-
🚀 Day 18 | Java Arrays – Core Java Learning Today, I learned about Arrays in Java, a fundamental data structure used to store multiple values of the same data type efficiently. 🔹 What is an Array? An array is an object in Java that allows storing multiple values under a single variable name. 🔹 Key Points Covered: Arrays store elements of same data type. Types of arrays in Java: 1D Array 2D Array 3D Array Difference between: Regular Arrays (equal number of columns) Jagged Arrays (unequal number of columns) 🔹 Array Declaration Syntax: dataType[] arrayName; 🔹 Example: int[] a; 🔹 Accessing Elements: 1D: a[3] 2D: a[1][0] 3D: a[1][0][2] ✨ Arrays help in writing clean, structured, and efficient code and are widely used in real-world applications. #Day18 #Java #ArraysInJava #CoreJava #Programming #TapAcademy #LearningJourney #SoftwareDeveloper
To view or add a comment, sign in
-
-
Java Tutorial 10 🚀 ► https://lnkd.in/gXaFeHgE ► Learn how to find the range of all primitive data types in Java. This tutorial covers memory allocation and value ranges for each type. Follow the example code to print the minimum and maximum values of byte, short, int, long, float, double, char, and boolean. Ideal for Java beginners! Java Tutorials Playlist: ► https://lnkd.in/gz2_iusM #Java #Programming #Coding #JavaTutorial #LearnJava #SoftwareDevelopment
To view or add a comment, sign in
-
-
Java Tutorial 10 🚀 ► https://lnkd.in/gzBxxNGR ► Learn how to find the range of all primitive data types in Java. This tutorial covers memory allocation and value ranges for each type. Follow the example code to print the minimum and maximum values of byte, short, int, long, float, double, char, and boolean. Ideal for Java beginners! Java Tutorials Playlist: ► https://lnkd.in/g-MdeE8X #Java #Programming #Coding #JavaTutorial #LearnJava #SoftwareDevelopment
To view or add a comment, sign in
-
-
Understanding Marker Interfaces in Java — Simple Concept, Powerful Impact Today I explored an interesting Core Java concept: Marker Interface. A Marker Interface is an empty interface (no methods, no fields) used to mark a class. This mark tells the JVM or compiler that the class has some special behavior or permission. In simple terms — it’s a way to attach metadata through inheritance. 💡 Why Marker Interfaces matter: They help Java decide: ✅ How an object should be treated ✅ Which operations are allowed or restricted ✅ What special behavior must be applied Even though they look “empty,” they play a huge role behind the scenes — classic examples include Serializable, Cloneable, and RandomAccess. Learning this made me realize how Java uses design patterns at a deep level to control behavior without adding extra code. Grateful for the guidance and clarity from my mentor Anand Kumar Buddarapu 🙏 Still learning Core Java step by step — building strong fundamentals. 💻🔥 #Java #CoreJava #MarkerInterface #OOP #JavaLearning #BackendDevelopment #StudentDeveloper #LearningByDoing
To view or add a comment, sign in
-
Today, I strengthened my understanding of Method Overloading in Java — an important concept of compile-time polymorphism. 🔹 Key Rules I Learned: ✔ Method name must be the same ✔ The number of parameters can be different ✔ The data type of parameters can be different ✔ The order of parameters can be different ✔ Changing only the return type does NOT support overloading 🔹 Understanding Type Promotion Java follows this order during method resolution: byte → short → int → long → float → double Java first looks for an exact match. If not found, it promotes the smaller data type to the next higher type. Practicing these fundamentals is helping me build a strong base in Core Java and improve my problem-solving skills step by step. TAP Academy #Java #CoreJava #MethodOverloading #Programming #JavaDeveloper #LearningJourney
To view or add a comment, sign in
-
-
💡 Java Learning Series – final vs finally vs finalize These three terms sound similar in Java but have completely different purposes. Here’s a simple breakdown: ✔️ final – A keyword used to restrict modification. → Final variable = constant value → Final method = cannot be overridden → Final class = cannot be inherited ✔️ finally – A block used in exception handling. → Always executes whether an exception occurs or not → Commonly used for closing resources like files or database connections ✔️ finalize() – A method called by the garbage collector before object destruction (now rarely used and mostly deprecated in modern Java). Understanding these small differences helps avoid confusion and write better Java code.🚀 #Java #CoreJava #Programming #JavaDeveloper #CodingJourney #LearningJava
To view or add a comment, sign in
-
Day 12 of Learning Java 💻 Today I learned something interesting about Runtime Polymorphism. In Java, the method that gets executed is decided at runtime, not at compile time. Even if a parent class reference is used, the child class method gets called. Example idea: Parent ref = new Child(); Even though the reference is of Parent type, the overridden method of Child runs. This is called Dynamic Method Dispatch. It works because of: ✔ Method Overriding ✔ Inheritance ✔ Upcasting It’s powerful because it allows flexibility and loose coupling in programs. Java decides which method to execute based on the object, not the reference type — and that’s what makes runtime polymorphism so interesting #Java #OOP #RuntimePolymorphism #MethodOverriding #DynamicMethodDispatch #100DaysOfCode #ProgrammingJourney #SoftwareDevelopment #CodingLife
To view or add a comment, sign in
-
-
Java Practice – Checking Two Arrays Are Same 🔎 Today I worked on a Java program to check whether two arrays contain the same elements. 🔹 Problem: Given two arrays, determine if both arrays have the same values (even if the order is different). 🔹 My approach: • First compared the lengths of both arrays • If lengths were not equal → arrays are not same • Then used nested loops to compare each element of the first array with elements of the second array • For every element, checked whether a matching value exists in the other array • If any element was not found → printed "Not" • If all elements matched → printed "same" 🔹 Concepts used: • Arrays • Nested loops • Conditional statements • Logic building This exercise helped me improve my understanding of array comparison and searching logic in Java. Special thanks to: Saketh Kallepu Anand Kumar Buddarapu Uppugundla Sairam #JavaLearning #Arrays #JavaProgramming #ProblemSolving #CodingPractice #Codegnan #LearningJourney
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