🚀Day 4(Part 3) | core java learning journey ☕ 📘 Topic: Operators in Java Today I learned about Operators in Java, which are used to perform different types of operations on variables and values. Operators play a very important role in writing logic, conditions, and calculations in Java programs. 🔹 1. Unary Operators Unary operators work on a single operand. Examples: +, -, ++, --, ! They are mainly used to increment, decrement, or negate values. 🔹 2. Arithmetic Operators Used to perform mathematical calculations. Examples: +, -, *, /, % These operators are commonly used for addition, subtraction, multiplication, division, and modulus operations. 🔹 3. Relational Operators Used to compare two values and return a boolean result (true or false). Examples: ==, !=, >, <, >=, <= They are mostly used in decision-making statements like if and while. 🔹 4. Logical Operators Used to combine multiple conditions. Examples: && (AND), || (OR), ! (NOT) These operators are very helpful in complex conditional expressions. 🔹 5. Bitwise Operators Operate on bits and perform bit-by-bit operations. Examples: &, |, ^, ~ They are mainly used in low-level programming and performance optimization. 🔹 6. Assignment Operators Used to assign values to variables. Examples: =, +=, -=, *=, /= They help in updating variable values efficiently. 🔹 7. Shift Operators Used to shift bits to the left or right. Examples: <<, >>, >>> These operators are useful for fast calculations and bit manipulation. 🔹 8. Ternary Operator A shorthand way to write conditional statements. 🙏 Grateful to my mentor: Vaibhav Barde Sir for continuous guidance and support. #CoreJava #JavaOperators #JavaLearning #ProgrammingBasics #CodingJourney #FortuneCloud
Java Operators: Core Concepts and Examples
More Relevant Posts
-
🚀 Day 6 | Core Java Learning Journey 📘 Topic: Looping Statements in Java Continuing my Core Java learning journey, today I explored loops in Java, which are used to execute a block of code repeatedly based on a given condition. Loops help reduce code redundancy and make programs more efficient and readable. 🔑 Concepts Explored Today: 🔹 for Loop Used when the number of iterations is known in advance. It is commonly used for counter-controlled loops. Syntax: for(initialization; condition; update) { // code to be executed } 🔹 while Loop Used when the number of iterations is not fixed. The condition is checked before executing the loop body. Syntax: while(condition) { // code to be executed } 🔹 do–while Loop Similar to the while loop, but the loop body executes at least once because the condition is checked after execution. Syntax: do { // code to be executed } while(condition); 📌 Why this matters: Loops are a fundamental part of programming and are essential for tasks like iteration, data processing, and automation. Understanding loops is crucial for writing efficient logic, working with arrays and collections, and building real-world Java applications. Special thanks to my mentor Vaibhav Barde Sir, for his guidance and clear explanation of Java loops, which made these concepts easy to understand. Step by step, strengthening my Core Java foundation and learning how to write cleaner and more optimized code. 💻🚀 #Java #CoreJava #Loops #ForLoop #WhileLoop #DoWhileLoop #ProgrammingFundamentals #JavaBasics #LearningJourney #BackendDevelopment #DailyLearning
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
-
🚀 Day 7 | Core Java Learning Journey 📌 Topic: Arrays in Java Today, I learned about Arrays in Core Java, one of the most important data structures used to store multiple values efficiently using a single variable. 🔹 What is an Array? An array is a data structure that stores multiple values of the same data type in contiguous memory locations, allowing fast access using index values. 🔹 Advantages of Arrays ✅ Helps in code optimization by reducing multiple variable declarations ✅ Provides fast data access using index ✅ Improves performance due to contiguous memory allocation ✅ Useful for handling large amounts of similar data 🔹 Disadvantages of Arrays ❌ Fixed size (cannot be resized dynamically) ❌ Memory wastage if allocated size is not fully utilized ❌ Stores only homogeneous data ❌ Insertion and deletion operations are costly 🔹 Types of Arrays in Java 1️⃣ One-Dimensional Array Used to store elements in a linear form. Syntax : int a[ ] = new int[size]; 2️⃣ Two-Dimensional Array Stores data in rows and columns (matrix form). Syntax: int a[ ][ ] = new int[rows][columns]; 3️⃣ 3D Array Used to store data in three dimensions, useful for complex data representation. Syntax : int a[ ][ ][ ] = new int[x][y][z]; 4️⃣ Jagged Array An array of arrays where each row can have a different size. Syntax : int a[ ][ ] = new int[rows][ ]; 📌 Key Learning: Arrays help in writing cleaner, optimized, and efficient code and form the foundation of advanced data structures. A special thanks to Vaibhav Barde Sir for his clear explanations and consistent support throughout the learning process. Looking forward to learning more Core Java concepts ahead! 💻✨ #CoreJava #JavaDeveloper #BackendEngineering #SoftwareDeveloper #ComputerScienceGraduate #ProgrammingLife #TechLearning #JavaConcepts
To view or add a comment, sign in
-
-
🚀 Java Learning Series — Day 10/100 📘 Relational & Logical Operators in Java Today I learned about Relational and Logical operators, which are essential for comparison, validation, and decision-making in Java applications. 🔹 Relational Operators Used to compare values and return a boolean result. == → Checks whether two values are equal != → Checks whether two values are different > → Verifies if the left value is greater than the right < → Verifies if the left value is smaller than the right >= → Checks if a value meets or exceeds a limit <= → Checks if a value is within an allowed range 🔹 Logical Operators Used to combine multiple conditions. && (AND) → True only when all conditions are true || (OR) → True when at least one condition is true ! (NOT) → Reverses the result of a condition 🔐 Real-Time Example: Login Validation 💡 Idea Behind the Example This program simulates a real-world login system where access is granted only when: Username matches Password matches User age is 18 or above Relational operators are used to compare values, while logical operators combine all login rules into a single boolean expression. The final result is stored in a boolean variable, which determines whether the login is successful or failed — without using conditional statements. 📸 (Code image attached below) ✨ Key Takeaways Relational operators handle value comparison Logical operators connect multiple validation rules Boolean expressions can decide outcomes efficiently Widely used in authentication and form validation systems 📌 Day 10 completed successfully! #Java #CoreJava #JavaDeveloper #BackendDevelopment #BackendDeveloper #SoftwareDevelopment #Programming #Coding #CleanCode #Authentication #SystemDesignBasics #ProblemSolving #DeveloperJourney #LearningInPublic #100DaysOfJava # Meghana M # 10000 Coders
To view or add a comment, sign in
-
-
✨ Understanding Encapsulation in Java | TAP Academy As part of my Java learning journey, I explored Encapsulation, one of the core principles of Object-Oriented Programming (OOP). 🔐 What is Encapsulation? Encapsulation is the process of providing security to the components (variables) of an object and controlling access to them. It helps in: ✔ Protecting data ✔ Preventing unauthorized access ✔ Improving maintainability ✔ Increasing code flexibility 🔒 How is Security Provided? Security is achieved using the private access modifier. When we declare instance variables as private, they cannot be accessed directly from outside the class. 🎛 How is Control Access Provided? Control access is achieved using: ✅ Setter methods ✅ Getter methods ✏ Setter Method Used to set (initialize/update) data Always takes input parameters Always has void return type 📖 Getter Method Used to get (retrieve) data Does not take any input parameters Return type depends on the data type of the variable ⚠ Naming Convention & Shadowing Problem To follow proper encapsulation: Input parameter name is often kept same as instance variable name Example: private int age; public void setAge(int age) { age = age; // Naming clash (Shadowing Problem) } Here, the local variable shadows the instance variable. This is called the Shadowing Problem. ✅ Solution: Using this Keyword To resolve this issue, we use the this keyword. this refers to the currently executing object. public void setAge(int age) { this.age = age; // Correct way } this.age → refers to instance variable age → refers to method parameter Thus, this helps in clearly differentiating between instance variables and local variables. ✨ Conclusion Encapsulation ensures: Data Security Controlled Access Clean & Maintainable Code It is one of the strongest pillars of Object-Oriented Programming. #Java #OOPS #Encapsulation #Programming #LearningJourney #TAPAcademy 🚀
To view or add a comment, sign in
-
-
📘 Day 3 of My Java Learning Journey 🚀 Today, I learned about Java tokens, identifiers, literals, comments, and some basic commands & separators. Sharing my understanding..... 🔹 What are Tokens in Java? A token is the smallest unit in a Java program. Java tokens include: ▪️Keywords ▪️Identifiers ▪️Literals ▪️Comments ▪️Separators 🔹 Keywords Keywords are predefined words in Java. Each keyword has a specific meaning. Keywords are always written in lowercase. Examples: class, public, static, void, if, else, return, etc. 👉 Keywords cannot be used as identifiers. 🔹 Identifiers Identifiers are names used to identify variables, methods, classes, etc... Rules for Identifiers: 1.Should not start with a digit. 2.No spaces allowed. 3.Keywords are not allowed. 4.Special characters are not allowed except $ and _. ⭐Naming Conventions 💠PascalCase Used for class & interface names. Example: StudentDetails, EmployeeData. 💠CamelCase Used for variables & method names. Example: studentName, calculateSalary. 🔹 Literals A literal is a value assigned to a variable. Types of Literals in Java: 1️⃣ Number Literal – Numbers (0–9) 2️⃣ Character Literal – Single character enclosed with single quotes ' '. Example: 'A', 'b', '1' 3️⃣ Boolean Literal – true and false (lowercase only) 4️⃣ String Literal – Sequence of characters enclosed with double quotes " ". Example: "Java", "Learning". 🔹 Comments in Java Comments are used to explain code (not executed). Single-line comment → // Multi-line comment → /* */ 🔹 Basic Java Commands javac filename.java → Compile the code java ClassName → Execute the program cd → Change directory mkdir → Create folder cls → Clear screen 🔹 Separators in Java { } → Braces ( ) → Parentheses [ ] → Arrays ; → Statement termination , → Comma : → Colon #Java #LearningJourney #JavaDeveloper #ProgrammingBasics
To view or add a comment, sign in
-
🚀 Day 13 | Core Java Learning Journey 📌 Topic: Inheritance in Java Today, I explored Inheritance, a fundamental pillar of Object-Oriented Programming in Java that promotes code reusability and logical hierarchy. 🔹 What is Inheritance? ✔️ Inheritance allows one class to acquire properties & behaviors of another class ✔️ Helps create parent-child relationships between classes ✔️ Achieved using the extends keyword 📌 Key Idea: Child Class → Reuses Parent Class features Example: class Animal { void eat() { System.out.println("Eating..."); } } class Dog extends Animal { void bark() { System.out.println("Barking..."); } } public class Main { public static void main(String[] args) { Dog d = new Dog(); d.eat(); // inherited method d.bark(); } } 🔹 Advantages of Inheritance ✔️ Code reusability ✔️ Reduces redundancy ✔️ Improves maintainability ✔️ Supports method overriding (runtime polymorphism) ✔️ Creates clear class hierarchy 🔹 Types of Inheritance in Java 1️⃣ Single Inheritance One child inherits one parent 2️⃣ Multilevel Inheritance Chain of inheritance (Parent → Child → Grandchild) 3️⃣ Hierarchical Inheritance Multiple children inherit the same parent 4️⃣ Hybrid Inheritance (via Interface) Combination of inheritance types using interfaces 5️⃣Multiple Inheritance (via Interface) Java classes don’t support multiple inheritance directly Achieved using interfaces 📌 Quick Summary ✔️ Inheritance = Reuse & Extension of existing code ✔️ Implemented using extends ✔️ Multiple inheritance possible via interfaces Special thanks to Vaibhav Barde Sir for making concepts simple and practical. Excited to keep learning and building 🚀💻 #CoreJava #JavaLearning #OOP #Inheritance #JavaDeveloper #LearningJourney
To view or add a comment, sign in
-
-
🚀 Learning Update: Sorting Custom Objects Using ArrayList in Java Today I worked on an interesting Java concept — sorting custom objects stored in an ArrayList. In real-world applications, we often deal with objects like Students, Employees, or Products instead of primitive data types. Learning how to sort these objects efficiently is an important skill for writing clean and scalable code. 🔹 What I learned: ✅ Creating a custom class with attributes ✅ Storing objects inside an ArrayList ✅ Sorting objects using Comparator with lambda expressions ✅ Writing cleaner and more readable Java code Here’s a simple example I practiced: 💡 Key takeaway: Java provides powerful tools like Comparator and lambda expressions that make sorting objects flexible and easy without modifying the original class. Every day learning something new and strengthening my Java fundamentals 💻✨ #Java #Programming #LearningJourney #SoftwareDevelopment #JavaDeveloper #Coding #Collections #OOP
To view or add a comment, sign in
-
-
🌟 Day 15 – Java Learning at TAP Academy: Strings Uncovered! 🌟 Today, I dove deep into Java Strings – one of the most subtle yet crucial topics in Java programming. Here’s a quick recap of what I learned: 💡 What’s a String? A sequence of characters in double quotes, but remember – in Java, Strings are objects, not primitives. Immutable by default! 🛠 Creating Strings 1️⃣ new String("Java") → Heap memory, duplicates allowed 2️⃣ "Java" → String Constant Pool, duplicates NOT allowed 3️⃣ From char[] → Heap memory, duplicates allowed 🧠 Memory Insights "Java" == "Java" → true (same pool object) new String("Java") == new String("Java") → false (different heap objects) Always use .equals() for value comparison 🔍 Comparing Strings == → reference comparison .equals() → case-sensitive value comparison .equalsIgnoreCase() → ignore case .compareTo() → lexicographical order ➕ Concatenation Rules + with literals → Pool (reuse) + with references → Heap .concat() → Always Heap (immutable strings, original unchanged) 🎯 Key Takeaways Pool = no duplicates, Heap = duplicates allowed Avoid == for values Concatenation behaves differently based on literals vs variables 💻 Practice Tip: Test scenarios like "A" vs new String("A"), + with literals & references to really internalize memory behavior. Learning Java is like exploring a layered maze – every day brings new insights! 🚀 #Java #StringInJava #TAPAcademy #Day15 #ProgrammingJourney #CodingTips #ImmutableStrings #JavaLearning
To view or add a comment, sign in
-
-
🌟 Day 30/100 of My Java Learning Journey! Today, I learned about Polymorphism, the third major concept of Object-Oriented Programming (OOPS) in Java. This concept helped me understand how the same action can behave differently in different situations. 🔹 What is Polymorphism? Polymorphism means “many forms.” In Java, it allows the same method name to perform different behaviors depending on the object or context. This helps make programs more flexible and scalable. 🔹 Types of Polymorphism in Java 1️⃣ Compile-Time Polymorphism Achieved using method overloading Same method name with different parameters Decided at compile time 2️⃣ Run-Time Polymorphism Achieved using method overriding Child class provides a specific implementation of a parent class method Decided at runtime 🔹 Why Polymorphism Is Important? Improves code flexibility Supports dynamic method behavior Reduces complexity Enhances code reusability Makes applications easier to extend 🌱 Reflection Learning polymorphism helped me understand how Java handles dynamic behavior in real-world applications. It showed me how one interface or method can support multiple implementations cleanly and efficiently. Feeling confident as I complete Day 30 of my Java learning journey! 🚀💪 🔖 #Day30 #Java #Polymorphism #OOPS #100DaysOfCode #LearningJourney #CodingLife #WomenInTech #JavaBasics #TechCareer #KeepGrowing
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