Day 14 of My Java Learning Journey 🚀 Today, I explored an important concept in Java: Pass by Value and Pass by Reference, which plays a key role in understanding how data is handled during method calls. 🔹 Pass by Value A copy of the variable’s value is passed to another variable or method Any changes made to the copied value do not affect the original variable Commonly seen with primitive data types 📌 Example: Changing one variable does not impact the original value since only the copy is modified. 🔹 Pass by Reference The reference (address) of an object is passed Multiple references can point to the same object in memory Changes made using one reference affect the original object Common with objects and class types 📌 Example: When two reference variables point to the same object, modifying the object using one reference reflects through the other. 🔹 Key Learning ✔ Java always uses pass by value, but for objects, the value passed is the reference, which is why object data can be modified ✔ Understanding this avoids confusion while working with methods, objects, and memory This topic helped me clearly understand how Java handles data internally and how reference sharing works in real programs. 📈 Consistent learning, one concept at a time. #Day14 #Java #CoreJava #PassByValue #PassByReference #ProgrammingConcepts #JavaDeveloper #LearningJourney
Java Pass by Value vs Pass by Reference Explained
More Relevant Posts
-
📘 Learning Java Basics – Daily Progress 🚀 Today I practiced and understood some important Java concepts by working through multiple code snippets and outputs. 🔹 Type Conversion & Casting Difference between int, float, byte, long Explicit casting using (int) How data loss happens during casting 🔹 Byte Data Type Behavior Why byte cannot store large arithmetic results How arithmetic operations convert byte values to int Use of compound assignment (+=) and overflow behavior 🔹 Character to Integer Conversion ASCII values of characters Implicit conversion from char to int Difference between pre and post increment with characters 🔹 Operators & Expressions Arithmetic operators Assignment operators (+=, -=, *=, /=) Understanding complex expressions step by step 🔹 Number Systems Binary, Octal, and Decimal values How Java interprets numbers like 001, 010, 100 Practicing these examples helped me improve my logical thinking, debugging skills, and confidence in Java fundamentals 💡 Learning every day, one concept at a time 💪 #Java #CoreJava #ProgrammingBasics #LearningJourney #JavaPractice #StudentDeveloper #Consistency #PlacementPreparation TAP Academy
To view or add a comment, sign in
-
-
🚀 Understanding Java Streams – The Right Way! While learning the Streams API in Java, I realized something very important: 👉 Streams do NOT store data. 👉 They create a processing pipeline. Many beginners think a Stream holds elements like a List. But actually: A Collection stores data 📦 A Stream processes data ⚙️ When we write: list.stream() .filter(x -> x > 10) .map(x -> x * 2) .forEach(System.out::println); What happens internally? 🔹 A pipeline is created 🔹 Operations are added (filter → map) 🔹 Execution starts only when a terminal operation (forEach) is called 🔹 Elements flow one-by-one through the pipeline It works like a conveyor belt in a factory 🏭 Data flows through stages — it is NOT stored in between. 💡 Key Takeaways: 1 ) Streams are lazy 2 ) Streams are single-use 3 ) Processing happens element-by-element 4 ) Terminal operation triggers execution Understanding this changed how I think about functional programming in Java. Always learning. Always improving. 💪 #Java #StreamsAPI #BackendDevelopment #FunctionalProgramming #JavaDeveloper #Learning
To view or add a comment, sign in
-
-
Day 2 of my Java learning journey 💻☕ Today I explored how Java programs actually make decisions and perform operations. I learned about operators and control statements, which are essential for building program logic. Here’s what I learned today: 🔹 Arithmetic Operators – Performing calculations like addition, subtraction, multiplication, division, and modulus. 🔹 Relational Operators – Comparing values to check conditions. 🔹 Logical Operators – Combining multiple conditions in a program. 🔹 Assignment Operators – Updating and storing values in variables. I also practiced control statements that control how a program runs: 🔸 if–else statements for decision making 🔸 for loops for repeating tasks 🔸 while loops for running code based on conditions Through practice programs, I worked on building logic such as: Checking even or odd numbers Finding the greater number Generating multiplication tables Calculating factorials Using loops to repeat tasks Slowly understanding how programs think and make decisions. Every day I'm getting more comfortable with Java fundamentals. Looking forward to learning functions, arrays, and strings next. #Java #Day2 #LearningInPublic #ProgrammingJourney #Consistency
To view or add a comment, sign in
-
-
📘 Day 16 of My Java Learning Journey Today, I revised Arrays in Java in more detail to strengthen my fundamentals. What is an Array? An array is a data structure that stores multiple values of the same data type under a single variable name. Instead of creating many separate variables, we can store all values in one array. Arrays 🔹 Regular Array – Equal number of columns (rectangular array) 🔹 Jagged Array – Unequal number of columns Syntax to Declare an Array data_type[] array_name; 📦 Types of Arrays 1️⃣ 1D Array – Single list int[] a = new int[5]; a[0] = 10; 2️⃣ 2D Array – Rows & columns int[][] a = new int[2][3]; a[1][2] = 30; 3️⃣ 3D Array – Multiple blocks int[][][] a = new int[2][3][4]; a[1][0][2] = 50; #Day16 #Java #Arrays #ProgrammingBasics #CodingJourney #LearningJava@Tap academy
To view or add a comment, sign in
-
-
📘 Day 30 of Learning Java – Scanner Class Today, I learned about the Scanner class in Java, which is used to take input from the user. 🔹 What is Scanner? Scanner is a predefined class in Java used to read input from different sources like keyboard input. 🔹 Package Information Scanner class is present in java.util package. String and System classes are present in java.lang package. java.lang is imported by default. But for Scanner, we must import: import java.util.Scanner; 🔹 System.in System.in is a standard input stream used to take input from the user. Example: Scanner sc = new Scanner(System.in); 🔹 Important Methods in Scanner Class ✔ To read integer → nextInt() ✔ To read short → nextShort() ✔ To read byte → nextByte() ✔ To read long → nextLong() ✔ To read float → nextFloat() ✔ To read double → nextDouble() ✔ To read boolean → nextBoolean() ✔ To read string (single word) → next() ✔ To read full line → nextLine() 💡 Today I clearly understood how Java handles user input and how different data types are read using different methods. Consistency is the key. Meghana M 10000 Coders Day 30 ✅ – Moving forward step by step. #Java #JavaLearning #Day30 #CodingJourney #Programming #DeveloperLife 🚀
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 – Java Learning Update 🚀 Today, I learned Unary and Bitwise Operators in Java and practiced how they manipulate values at both logical and binary levels. 🔹 Unary Operators Unary operators work on a single operand. ✔ + → Unary plus (indicates positive value) ✔ - → Unary minus (negates value) ✔ ++ → Increment (increases value by 1) a++ (Post-increment) / ++a (Pre-increment) ✔ -- → Decrement (decreases value by 1) a-- (Post-decrement) / --a (Pre-decrement) Pre operators Value is incremented first, then used in the expression. Post operators Value is used first, then incremented. ✔ ! → Logical NOT (reverses boolean value) Syntax Example: int a = 10; a++; // Increment --a; // Decrement 🔹 Bitwise Operators Bitwise operators work on binary (bit-level) values. ✔ & → Bitwise AND ✔ | → Bitwise OR ✔ ^ → Bitwise XOR ✔ ~ → Bitwise Complement ✔ << → Left Shift ✔ >> → Right Shift Syntax Example: int x = 5; // 0101 int y = 3; // 0011 #Java #CoreJava #JavaFullStack #UnaryOperators #BitwiseOperators #HandsOnLearning #SoftwareDeveloper #LearningJourney 10000 Coders Meghana M
To view or add a comment, sign in
-
📘 Learning Java Core Concepts – Day by Day 🚀 Today I spent time understanding some important Java fundamentals that explain how programs actually work in memory. 🔹 Program vs Process A program stored in hard disk becomes a process when it is loaded into RAM Multiple programs can run at the same time in memory 🔹 Java Runtime Environment (JRE) JRE is the small memory region allocated in RAM where Java programs execute JRE is divided into: Code Segment Stack Segment Static Segment Heap Segment 🔹 Variables in Java Instance Variables Created inside a class Stored in the Heap segment Get default values automatically Local Variables Created inside methods Stored in the Stack segment Must be initialized before use (no default values) 🔹 Memory Understanding Objects are created in the Heap Reference variables are stored in the Stack Default values depend on data types This learning helped me clearly understand memory allocation, variable behavior, and Java execution flow 💡 Step by step, building strong foundations 💪 #Java #CoreJava #LearningJourney #ProgrammingBasics #JavaMemory #StudentLearning #Consistency TAP Academy
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 11 | Core Java Learning Journey 📌 Topic: Class & Object in Java Today, I explored one of the most fundamental concepts of Object-Oriented Programming — Classes and Objects. 🔹 What is a Class? ✔️ A class is a blueprint or template for creating objects ✔️ It is a logical entity (not a real-world object) ✔️ A class itself does not occupy memory ✔️ It defines properties (fields) and behaviors (methods) 🔹 What is an Object? ✔️ An object is an instance of a class ✔️ It represents a real-world entity ✔️ Objects occupy memory ✔️ Objects allow us to access class members 📌 Key Insight: Class → Definition / Blueprint Object → Actual usable entity 🔹 Simple Example in Java class Animal { String name; void eat() { System.out.println(name + " is eating"); } } public class Main { public static void main(String[] args) { Animal a1 = new Animal(); // Object Creation a1.name = "Dog"; // Assigning value a1.eat(); // Calling method } } 📌 Explanation: ✔️ Animal → Class (blueprint) ✔️ a1 → Object (instance of Animal) ✔️ new → Allocates memory & creates object ✔️ Object is used to access fields & methods Understanding this concept makes the foundation of OOP much clearer and stronger. Special thanks to Vaibhav Barde Sir for the clear and practical explanations. Excited to keep moving forward in my Java learning journey 💻✨ #CoreJava #JavaLearning #OOP #ClassAndObject #JavaDeveloper #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