🚀 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
Java Arrays Fundamentals
More Relevant Posts
-
Understanding Variables in Java – The Building Blocks of Every Program In Java, variables are used to store data that a program can use and manipulate. Think of them as containers that hold values during program execution. What is a Variable? A variable is a named memory location that stores a specific type of data. Syntax: dataType variableName = value; Types of Variables in Java 1️⃣ Local Variables -> Declared inside a method or block -> Accessible only within that method -> Must be initialized before use 2️⃣ Instance Variables -> Declared inside a class but outside methods -> Each object gets its own copy -> Represent object-level data 3️⃣ Static Variables -> Declared using the static keyword -> Shared among all objects of the class -> Used for constants or common properties 🔹 Why Variables Matter 1. Store and manage data 2. Improve code readability 3. Enable dynamic behaviour in programs TAP Academy #Java #Programming #JavaBasics #Coding #SoftwareDevelopment #LearnJava
To view or add a comment, sign in
-
-
📘 Day 28 | Core Java Series Encapsulation is one of the most important pillars of Object-Oriented Programming in Java. It helps protect data and allows controlled access using methods. Remember this: Encapsulation = Data hiding + Controlled access If this concept is clear, writing secure and maintainable code becomes much easier. 📌 Save this for revision 💬 Feedback is welcome #Java #CoreJava #OOP #Encapsulation #LearningInPublic
To view or add a comment, sign in
-
-
Strengthening My Java Fundamentals! While learning Java, I explored the differences between: 🔹 String 🔹 StringBuffer 🔹 StringBuilder 🔹 StringTokenizer Here’s what I understood: ✅ String – Immutable (cannot be changed once created). Efficient for fixed data but creates new objects when modified. ✅ StringBuffer – Mutable and Thread-Safe. Best for multi-threaded environments where data consistency is important. ✅ StringBuilder – Mutable but Not Thread-Safe. Faster than StringBuffer and suitable for single-threaded applications. ✅ StringTokenizer – Used to break a string into tokens (words) based on delimiters. Understanding these concepts helped me improve my knowledge about memory management, performance optimization, and multithreading behavior in Java. #Java #CoreJava #LearningJourney #Programming #SoftwareDevelopment
To view or add a comment, sign in
-
-
Understanding the First Two Types of Methods in Java In Java, methods help avoid writing all logic inside the main method by separating functionality into reusable blocks of code. Among them, the first two basic types are: 🔹 Methods with no input and no output These methods do not take any parameters and do not return any value. They are mainly used to perform actions such as displaying messages or executing fixed tasks. 🔹 Methods with no input but with output These methods do not accept parameters but return a value. The returned result can be stored or used by the calling method, making the code more reusable and structured. Using these methods keeps the program clean, readable, and aligned with good programming practices. Main method initiates execution; methods perform the work. 🚀 hashtag #Java #Methods #OOP #Programming #LearningJava #CleanCode #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀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
-
-
I worked on a Java program to understand how constructors initialize objects in Object-Oriented Programming. 💻☕ In this project, I created a class Pen with different constructors to explore how object creation works with various inputs: • Used a no-argument constructor for default object creation 🧩 • Implemented parameterized constructors to pass values during object creation 📥 • Observed how constructor arguments influence object initialization 🔍 • Printed object references to understand default Java object representation 🖨️ This helped me build clarity on: • Object instantiation in Java ⚙️ • Role of constructors in initialization 🏗️ • Difference between object reference and actual data 🧠 A focused exercise to strengthen core Java fundamentals. 🚀 #Java #OOP #Constructors #JavaProgramming #CodingJourney #LearningJava #Developers
To view or add a comment, sign in
-
-
Day 13 - Java Collections 💻 Today I learned about the Java Collections Framework. Explored the main collection types: 🔹 List – Ordered collection, allows duplicates 🔹 Set – No duplicate elements 🔹 Map – Stores data in key–value pairs Also practiced basic CRUD operations: ✔ Create – Adding elements ✔ Read – Accessing elements ✔ Update – Modifying elements ✔ Delete – Removing elements Understanding when to use List vs Set vs Map is super important because it affects performance and data handling. Collections make data management much easier and more efficient in Java. OOP + Collections together are starting to feel powerful 🔥 #Java #JavaCollections #DataStructures #JavaLearning #ProgrammingJourney #100DaysOfCode #SoftwareDevelopment #CodingLife #TechLearning
To view or add a comment, sign in
-
-
Week 3 : Collection framework in java Day 11 : Collection framework : A Collection represent a group of object java collections provide classes and interfaces. Why need do we need Collections : We need collections for efficient storage and better manipulation of data in java. 1) Resize of an array. 2) Insert an element in between. 3) Delete and element in between. 4) Apply certain operations to change the array. Collection : The root interface for all the other collection types. 1) List : An ordered Collection that can contain duplicate elements . Example : arraylist, Linkedlist etc. 2) Set : A collection that cannot contains duplicate elements. Example : Hashset, Treeset. 3) Queue : A collection designed for holding elements prior to processing. 4) Deque : A double ended queue that allows insertion and removal at both ends. 5) Map : An interface that represents a collection of key value pairs . #java #backend #programming #collectionframeworks #learning #advancedjava EchoBrains
To view or add a comment, sign in
-
-
Java learning insights Today I learned the difference between throw vs throws in Java 🔹 throw → used to create an exception We use "throw" when we want to manually stop the program and send an error. if(balance < 1000){ throw new ArithmeticException("Insufficient balance"); } 🔹 throws → used to declare an exception We use "throws" in the method signature to tell the compiler that an exception may occur. public void readFile() throws IOException { // file reading code } Easy way to remember • throw → actually throws the exception • throws → warns about the exception Key takeaways: • throw is inside the method body • throws is used in method declaration • throw throws one exception at a time • throws can declare multiple exceptions #Java #ExceptionHandling #JavaLearning
To view or add a comment, sign in
-
-
Understanding Java Exception Hierarchy — Beyond Just Try-Catch While learning exception handling in Java, I realized that many beginners memorize exceptions without understanding their structure. Here is a simplified hierarchy: -> Object is the root class -> Throwable is the parent of all exceptions and errors # Two main branches: =>Errors -> Serious issues related to JVM -> Usually not handled in application code Example: VirtualMachineError, OutOfMemoryError =>Exceptions <>Checked Exceptions -> Checked at compile time -> Must be handled or declared using throws <>Unchecked Exceptions -> Occur at runtime -> Mostly due to programming mistakes Key learning: Understanding hierarchy makes it easier to decide: -> When to catch exceptions -> When to propagate them -> How Java differentiates compile-time vs runtime problems Special thanks to Prasoon Bidua sir for concept-based explanations. Open to feedback and better explanations. #Java #ExceptionHandling #CoreJava #BackendLearning #LearningInPublic
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