Day 6 | Full Stack Development with Java Today’s learning made me realize how important data conversion is while working with Java programs. I explored Type Casting — a concept that controls how data moves between different data types. What is Type Casting? Type casting is the process of converting one data type into another. In Java, this becomes important because Java is a strongly typed language. Two Types of Type Casting I Learned Today: Implicit Casting (Widening) – Automatic Happens when converting a smaller data type to a larger one. No data loss occurs. Example flow: byte → short → int → long → float → double The compiler handles it automatically. Explicit Casting (Narrowing) – Manual Used when converting a larger data type into a smaller one. Requires programmer intervention. Syntax example: byte b = (byte) a; May cause loss of precision, so it must be used carefully. Realization of the Day Understanding type casting helped me see how Java manages memory and prevents unexpected behavior during calculations. Even a small conversion can change program output — which shows why fundamentals matter so much in backend development. Learning step by step and connecting theory with real code is making this journey more interesting every day. #Day6 #Java #TypeCasting #FullStackDevelopment #LearningInPublic #ProgrammingJourney #SoftwareDevelopment
Java Type Casting: Implicit & Explicit Conversion
More Relevant Posts
-
✨DAY-5: 💻 Understanding Data Types in Java – So Many Options! 😄 Learning Java becomes fun when you explore Data Types — the foundation of every program! This meme creatively shows how Java gives us multiple choices to store and manage data efficiently: 🔹 int – For whole numbers 🔹 double – For decimal values 🔹 float – For smaller decimal values 🔹 boolean – True or False 🔹 char – Single character 🔹 String – Collection of characters (text) ✨ Just like the image says — “So Many Options!” Choosing the right data type improves performance, memory usage, and code clarity. 📌 Before jumping into advanced concepts like OOP or frameworks, mastering data types is very important. Strong basics = Strong developer 💪 #Java #CoreJava #DataTypes #Programming #CodingJourney #JavaDeveloper #Learning #DevelopersLife
To view or add a comment, sign in
-
-
✨DAY-22: 🚀 Learning Lambda Expressions in Java – Made Simple! Sometimes the best way to understand complex concepts is through real-world examples. In this image, sorting tools in a garage perfectly represents how Lambda Expressions in Java work. Instead of manually checking every tool, we use a clean and powerful lambda expression to filter only what we need — just like keeping only the wrenches from a mixed toolbox. List<Tool> sortedTools = tools.stream() .filter(t -> t.isWrench()) .collect(Collectors.toList()); 🔎 What’s happening here? 👉 stream() – Process the collection 👉 filter() – Apply a condition using a lambda expression 👉 collect() – Gather the filtered results Just like telling someone: “Only keep the wrenches!” That instruction is your lambda expression — short, clear, and powerful. 💡 Why Lambda Expressions? ✔ Cleaner code ✔ Less boilerplate ✔ Better readability ✔ Functional programming support in Java Java 8 introduced lambdas, and they completely changed how we write collection-processing logic. Sometimes coding isn’t about complexity — it’s about expressing logic in the simplest way possible. #Java #JavaProgramming #LambdaExpressions #Java8 #Coding #Developers #ProgrammingHumor
To view or add a comment, sign in
-
-
Day 3 of Java From Code to Memory 🧠💻 Today things got REAL. No more JVM theory. No more architecture talk. Today I learned how Java actually stores data inside memory. 👉 Variables. Sounds simple… but it’s powerful. When we write: int age = 21; Java doesn’t just “remember” 21. It: • Reserves space in memory • Decides how many bits to allocate • Stores the value in binary (0s & 1s) • Links it with the name age That moment when you realize… Programming = Managing Memory 🔥 Also understood: Java is statically typed. You must declare the data type first. No mixing random data. Strict but safe. Explored the 8 primitive data types: byte, short, int, long float, double char boolean And yes double wins over float for precision 👀 Biggest takeaway? Behind every simple line of code… there’s memory allocation, bits, and logic working silently. Day 3 and the foundation is getting stronger. We’re not just writing code anymore we’re understanding how machines think. Consistency > Motivation 🚀🔥 Special thanks to Aditya Tandon Sir & Rohit Negi Sir 🙌 #Java #CoreJava #LearningInPublic #Programming #Developers #BuildInPublic
To view or add a comment, sign in
-
-
🚀 Learning Update: Core Java – Encapsulation & Constructors 1️⃣ Understood Encapsulation practically, not just theoretically. 2️⃣ Learned how to protect data using the private access modifier. 3️⃣ Implemented controlled access using setters and getters. 4️⃣ Realized the importance of validating data inside setters (handling negative values, invalid inputs, etc.). 5️⃣ Implemented a real-world example using a Customer class with ID, Name, and Phone fields. 6️⃣ Learned about the shadowing problem when parameter names match instance variables. 7️⃣ Understood that local variables have higher priority inside methods. 8️⃣ Solved shadowing using the this keyword (currently executing object). 9️⃣ Gained clarity on constructors and how they are called during object creation. 🔟 Learned that constructors must have the same name as the class and do not have a return type. 1️⃣1️⃣ Understood the difference between default constructor, zero-parameterized constructor, and parameterized constructor. 1️⃣2️⃣ Learned that if we don’t create a constructor, Java automatically provides a default constructor. 1️⃣3️⃣ Explored constructor overloading and how Java differentiates constructors based on parameters. 1️⃣4️⃣ Understood the difference between constructors and methods (return type, calling time, naming rules). 1️⃣5️⃣ Gained better clarity on object creation flow, memory allocation, and execution order. Feeling more confident about explaining Encapsulation and Constructors clearly in interviews now! 💻🔥 #Java #CoreJava #OOPS #Encapsulation #Constructor #LearningJourney #PlacementPreparation TAP Academy
To view or add a comment, sign in
-
-
While learning object oriented programming in Java, the next step was understanding classes and objects. At first the terms sounded simple, but writing small examples made the idea clearer. Things that became clear : - a class acts like a blueprint that defines what properties and behaviours something will have - an object is the actual instance created from that blueprint - objects allow programs to represent real world entities in code - data and the operations on that data stay grouped inside the same structure - multiple objects can be created from the same class, each having its own state A simple example helped visualize this better : class Student { int rollNo; String name; void display() { System.out.println(rollNo + " " + name); } } Objects created from this class can store different student details while using the same structure. Understanding this idea made it clearer how Java programs move from simple logic to modelling real world entities. #java #oop #programming #learning #dsajourney
To view or add a comment, sign in
-
🚀 Day 50/100 – #JavaJourney Continuing the journey with a mix of DSA practice and Core Java learning. Today’s focus was revisiting some important LeetCode problems and strengthening Java fundamentals. 🧠 DSA Practice (LeetCode) 1️⃣ LC 1 – Two Sum (Hash Map Complement Approach) 2️⃣ LC 26 – Remove Duplicates from Sorted Array (Two Pointer Approach) 3️⃣ LC 35 – Search Insert Position (Linear / Binary Search Approach) 4️⃣ LC 27 – Remove Element (Two Pointer Approach) 5️⃣ LC 283 – Move Zeroes (Two Pointer + Swap / Write Approach) 6️⃣ LC 66 – Plus One Also progressing with Prefix Sum concepts, practicing problems like Subarray Range Sum and Maximum Subarray to better understand array patterns. 📚 Core Java Concepts Studied 1️⃣ Enums & Annotations 2️⃣ Functional Interfaces & Lambda Expressions 3️⃣ Exception Handling & Custom Exceptions 4️⃣ User Input Handling (BufferedReader & Scanner) 5️⃣ Multithreading Concepts (Threads, Runnable, Race Condition, Thread States) 📈 Key Takeaways • Revisiting classic problems helps reinforce important DSA patterns • Learning concepts like lambdas and multithreading adds deeper understanding of Java • Consistency with both DSA practice and Java fundamentals is helping me build stronger foundations 💻 Check out my work: 🔗 GitHub: https://lnkd.in/gGquYtVZ 🔗 LeetCode: https://lnkd.in/gaNyep3M Day 50 completed ✅ Halfway through the journey and still learning every day 🚀 #Java #DSA #LeetCode #CoreJava #Multithreading #Lambda #100DaysOfCode #CodingJourney #Consistency #ProblemSolving
To view or add a comment, sign in
-
Another important concept while working with classes in Java is the constructor. Constructors are closely related to object creation and help initialize the data inside an object. Things that became clear : • a constructor is a special method used to initialize objects • it has the same name as the class • constructors do not have a return type • they are called automatically when an object is created • they are commonly used to set initial values for instance variables A simple example helps illustrate the idea : class Employee { String name; int age; Employee() { System.out.println("Constructor called"); } } Whenever an object of the class is created, the constructor runs automatically and prepares the object for use. Understanding constructors made it clearer how Java ensures that objects start with proper initial values. #java #oop #programming #learning #dsajourney
To view or add a comment, sign in
-
Another concept that appears while studying class initialization in Java is the instance block. It behaves differently from static blocks and is tied to object creation rather than class loading. Things that became clear : • an instance block runs every time an object of the class is created • it executes before the constructor • it can be used to perform common initialization steps for objects • unlike static blocks, instance blocks run for each object created • they are part of the object initialization process A simple structure shows the execution flow : class Demo { { System.out.println("Instance block executed"); } Demo() { System.out.println("Constructor executed"); } public static void main(String[] args) { Demo d = new Demo(); } } When the object is created, the instance block executes first and then the constructor runs. Understanding this order helps in seeing how Java prepares an object step by step during creation. #java #oop #programming #learning #dsajourney
To view or add a comment, sign in
-
📝Day-5 Today, I strengthened my basics by learning about Data Types in Java. 🔹 Data types define what kind of value a variable can store. 🔹 Java has two main categories: 🟢 Primitive Data Types byte | short | int | long | float | double | char | boolean ✔ Store actual values ✔ Fixed memory size ✔ Faster execution 🔵 Non-Primitive Data Types String | Arrays | Classes | Interfaces ✔ Store reference (address) ✔ Can use methods ✔ No fixed size Understanding data types is the foundation of writing efficient and optimized programs. Strong basics lead to strong logic 💡 Every small concept I learn is helping me grow step by step in my Java Full Stack journey. #Java #JavaProgramming #ProgrammingBasics #FullStackDeveloper #CodingJourney #LearningJava #TechJourney #TapAcademy
To view or add a comment, sign in
-
-
🔐 Understanding Encapsulation in Java – A Core OOP Principle As part of strengthening my Object-Oriented Programming fundamentals, I explored the concept of Encapsulation in Java. Encapsulation is the process of binding data (variables) and methods (functions) together into a single unit — typically a class — and restricting direct access to the data. This is achieved using private variables and public getter and setter methods. Why is Encapsulation important? ✅ Improves data security ✅ Controls access to class members ✅ Enhances code maintainability ✅ Makes debugging easier ✅ Supports modular programming For example, in a Restaurant class, attributes like id, name, email, phone, and address are declared as private. They can only be accessed or modified using public getter and setter methods. This ensures that invalid or unwanted data cannot directly affect the object’s state. Encapsulation follows the principle: “Hide the implementation details and expose only what is necessary.” Learning this concept helped me better understand how real-world applications protect sensitive data and maintain clean architecture. Continuing my journey in Java and strengthening my OOP concepts step by step 🚀 #Java #OOP #Encapsulation #Programming #SoftwareDevelopment #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