Day 26: Checking Anagrams in Java While practicing Java problem solving, I worked on a simple yet interesting problem — checking whether two strings are Anagrams. Anagrams are words formed by rearranging the letters of another word using all the original characters exactly once. Examples: silent and listen throw and worth 🧠 Approach I Used First, check if both strings have the same length. If not, they cannot be anagrams. Convert both strings to lowercase and then to character arrays. Sort both arrays using Arrays.sort(). Compare each character of both arrays. If all characters match, the strings are anagrams. 🧪 Example Output silent & listen → Anagrams aabb & aaab → Not Anagrams What I Practiced String manipulation in Java Converting strings to character arrays Using Arrays.sort() Iterating and comparing array elements Small problems like this help strengthen core Java fundamentals and problem-solving skills. #Java #Programming #ProblemSolving #CodingPractice #DSA Raviteja T Mohammed Abdul Rahman 10000 Coders
Checking Java Anagrams with String Manipulation
More Relevant Posts
-
Today I Learned Operators in Java Understanding operators is essential for writing efficient and logical Java programs. Operators allow us to perform operations on variables and values, making them a core building block of programming. --> Types of Operators in Java 1. Arithmetic Operators Used for mathematical calculations Example: + - * / % 2. Relational Operators Used to compare two values and return a boolean result (true or false) Example: == != > < >= <= 3. Logical Operators Used to combine multiple conditions Example: && || ! 4. Assignment Operators Used to assign values to variables Example: = += -= *= /= %= 5. Unary Operators Operate on a single operand Example: ++ -- ! 6. Ternary Operator A shorthand form of the if-else statement Example: int max = (a > b) ? a : b; Key Takeaways --> Operators help perform computations and decision-making in programs --> Relational operators always return a boolean value --> The ternary operator simplifies conditional logic --> Understanding operators improves code readability and efficiency -->Currently strengthening my Java fundamentals as part of my learning journey in software development. #Java #JavaProgramming #LearnJava #JavaDeveloper #ProgrammingBasics #Coding #SoftwareDevelopment #Developers #TechLearning #CodeNewbie #JavaConcepts #ProgrammingJourney
To view or add a comment, sign in
-
-
🚀 Day 25 / 30 – Java Learning Journey Today I explored Queue and Deque in Java from the Java Collections Framework. 🔹 Queue Interface A Queue follows the FIFO (First In First Out) principle where elements are inserted at the rear and removed from the front. Key methods: • add() / offer() → insert element • remove() / poll() → remove element • element() / peek() → access the head element 🔹 Implementations of Queue • Hash-based and linked structures like LinkedList • Priority-based queues using PriorityQueue • Double-ended structures like ArrayDeque 🔹 Deque (Double Ended Queue) Deque allows insertion and deletion from both the front and rear. Important methods: • addFirst(), addLast() • removeFirst(), removeLast() • peekFirst(), peekLast() 🔹 PriorityQueue Elements are ordered by priority (default uses min-heap), where the smallest element is always at the head. 🔹 ArrayDeque A resizable array implementation of Deque that is usually faster than LinkedList for queue operations. 💡 Applications • Task scheduling • BFS algorithm in graphs • Printer queue • Top K elements problems Day 25 complete ✔️ Continuing the journey of mastering Java step by step. #Java #JavaCollections #Queue #Deque #JavaLearning #30DaysOfJava
To view or add a comment, sign in
-
-
🚀 Day 13 of My Java Journey Today I explored Java Keywords — the building blocks of Java programming 💻 🔑 Key Learnings: • Java has 53 reserved keywords • Keywords are predefined & cannot be used as identifiers • All keywords are written in lowercase • Learned categories: 👉 Program Control (if, else, for, while...) 👉 OOP Concepts (class, interface, extends...) 👉 Miscellaneous (import, package, this...) 💡 Interesting Fact: "true", "false", and "null" are reserved literals, not keywords! ⚠️ Bonus Tip: Keywords like "goto" and "const" are reserved but not used in Java Aman Soni 📌 Understanding keywords is the first step to mastering Java syntax and logic. #Java #Programming #CodingJourney #100DaysOfCode #JavaDeveloper #Learning #Tech #Beginners #CodeNewbie #DeveloperJourney
To view or add a comment, sign in
-
-
📘 Toggle Case in a String Using Java | String Manipulation Practice Continuing my Java programming and problem-solving journey, I implemented a program to toggle the case of characters in a string. The program converts uppercase letters to lowercase and lowercase letters to uppercase, while keeping digits unchanged. This helped me practice character handling and string traversal in Java. 🔎 What this implementation demonstrates: ✅ Taking string input from the user using Scanner ✅ Iterating through each character of a string ✅ Identifying uppercase letters, lowercase letters, and digits ✅ Converting case using Java Character class methods ✅ Keeping numeric characters unchanged 💻 Key Concepts Practiced: ✔ Java String handling ✔ Character classification using Character.isUpperCase() and Character.isDigit() ✔ Case conversion using Character.toUpperCase() and Character.toLowerCase() ✔ Looping through characters using charAt() 📌 Example Execution Input: hell2Jio7WellDeserve54ByE Output after toggling case: HELL2jIO7wELLdESERVE54bYe 🔎 Important Learning Moment: While implementing this program, I learned how Java’s Character utility methods help efficiently process and manipulate text data. 🚀 Step by step, continuing to strengthen my Java fundamentals, problem-solving skills, and DSA concepts. #Java #Programming #CodingPractice #StringManipulation #DSA #LearningJourney #StudentDeveloper #JavaProgramming
To view or add a comment, sign in
-
-
Boost Your Java Skills with This Quick Tutorial! Are you learning Java or looking to sharpen your programming skills? Check out my latest video on If Else If ladder ! In this video, you will learn: ✅ The basics of If Else if ladder ✅ How to write clean and efficient code ✅ Real-world examples and practical use cases ✅ Tips to avoid common mistakes Whether you are a beginner, a student, or an aspiring Java developer, this tutorial will make easy to understand and implement. 📺 Watch here: https://lnkd.in/gNhXXHEA 💡 Don’t forget to like, share, and comment your thoughts! Your feedback helps me create more useful tutorials. #Java #JavaProgramming #Coding #LearnJava #Programming #SoftwareDevelopment #TechTips #JavaForBeginners
Java If Else If Ladder Explained Simply
https://www.youtube.com/
To view or add a comment, sign in
-
DAY 30: CORE JAVA 🚀 Understanding "this()" vs "super()" in Java – A Quick Guide! While working with constructors in Java, two important calls often come into play: "this()" and "super()". Though they may seem similar, they serve very different purposes. 🔹 "this()" Call - Used to achieve constructor chaining within the same class. - Helps reuse constructors in a clean and efficient way. - It is optional and depends on the programmer’s need. 🔹 "super()" Call - Used to achieve constructor chaining between parent and child classes. - It is automatically invoked by Java (default behavior). - Always placed on the first line of the child class constructor. ⚠️ Important Rule 👉 "this()" and "super()" cannot be used together in the same constructor, as both must be the first statement. 💡 Key Insight Subclass variables always have higher priority than superclass variables. To access parent class variables when both have the same name, we use "super". 📌 Mastering these concepts is essential for writing clean and efficient code using inheritance in Java. TAP Academy #Java #OOP #Programming #CodingTips #SoftwareDevelopment
To view or add a comment, sign in
-
-
While learning core Java concepts, I recently explored the Collection Hierarchy, and it gave me a clearer understanding of how Java manages and organizes groups of objects efficiently. The Java Collection Framework provides a set of interfaces and classes designed to store, retrieve, and manipulate data in different ways depending on the requirement. 🔹 List – Maintains insertion order and allows duplicate elements. Examples: ArrayList, LinkedList, Vector, Stack. 🔹 Set – Stores only unique elements and prevents duplication. Examples: HashSet, LinkedHashSet, TreeSet. 🔹 Queue – Designed for processing elements typically in FIFO (First In First Out) order. Examples: PriorityQueue, ArrayDeque. Understanding this hierarchy helps developers choose the right data structure based on ordering, uniqueness, and performance requirements. #Java #JavaCollections #SoftwareDevelopment #JavaDeveloper #Programming #Learning
To view or add a comment, sign in
-
-
Boost Your Java Skills with This Quick Tutorial! Are you learning Java or looking to sharpen your programming skills? Check out my latest video on Escape Sequence! In this video, you will learn: ✅ The basics of Escape sequence ✅ How to write clean and efficient code ✅ Real-world examples and practical use cases ✅ Tips to avoid common mistakes Whether you are a beginner, a student, or an aspiring Java developer, this tutorial will make easy to understand and implement. 📺 Watch here: https://lnkd.in/g7yUqXnS 💡 Don’t forget to like, share, and comment your thoughts! Your feedback helps me create more useful tutorials. #Java #JavaProgramming #Coding #LearnJava #Programming #SoftwareDevelopment #TechTips #JavaForBeginners
Escape Sequences in Java Explained with Examples
https://www.youtube.com/
To view or add a comment, sign in
-
🚀 Mastering Java Switch Statements – From Basic to Advanced I recently practiced different ways of using switch statements in Java, and here’s what I learned step-by-step 👇 🔹 1. Traditional Switch (Basic) ➡️ Used multiple case blocks with break statements ➡️ Works but repetitive and lengthy 🔹 2. Grouping Cases ➡️ Combined multiple cases using commas ➡️ Cleaner and reduces duplication 🔹 3. Switch with Arrow (->) ➡️ Introduced modern syntax ➡️ No need for break ➡️ More readable and concise 🔹 4. Using Variable for Output ➡️ Stored result in a variable ➡️ Better for structured and reusable code 🔹 5. Switch as Expression ➡️ Directly returns value ➡️ Makes code shorter and powerful 🔹 6. Using yield Keyword ➡️ Used in block-style switch expressions ➡️ Helps return values explicitly ➡️ Converted output to uppercase for better formatting ✨ Key Takeaways: ✔ Code readability improved step by step ✔ Reduced redundancy ✔ Learned modern Java features ✔ Understood difference between statement vs expression 🙏 Grateful for the Guidance: A special thanks to my mentor Anand Kumar Buddarapu sir for guiding me and encouraging me to explore Java pattern programming and logical coding techniques. Saketh Kallepu Uppugundla Sairam #Java #Programming #CodingJourney #JavaDeveloper #Learning #SwitchCase #CleanCode #TechSkills #Developers #StudentDeveloper
To view or add a comment, sign in
-
-
🚀 Day 25 of My Java Learning Journey Today I learned about the Object Class in Java and its important methods. 🔹 The Object class is the parent of all classes in Java. 🔹 toString() is used to convert an object into a readable string format. 🔹 clone() is used to create a copy of an object. 🔹 Java is not a purely object-oriented language because it uses primitive data types like int, char, and float. 🔹 Wrapper classes such as Integer, Double, and Character help convert primitive types into objects. Example: Employee e = new Employee(); System.out.println(e); Internally, Java calls: e.toString(); Every day I am improving my Java skills step by step 💪 Consistency + Practice = Growth 📈 #Java #ObjectOrientedProgramming #Programming #LearningJourney #100DaysOfCode #SoftwareDevelopment
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