💻 Day 13 – File Handling in Java Today I explored File Handling in Java, which allows programs to create, read, write, and manage files. This is an important concept because real-world applications often need to store and retrieve data from files. Things I learned today: 🔹 How to create a file using File class 🔹 Writing data into a file using FileWriter 🔹 Reading data from a file 🔹 Handling errors using IOException File handling helps programs store information permanently instead of losing it when the program ends. 💡 Key takeaway: File handling enables Java programs to interact with external data and manage information efficiently. Learning something new every day and strengthening my Java fundamentals step by step 🚀 #Java #FileHandling #Programming #LearningInPublic #CodingJourney #ComputerScience #Day13
Java File Handling Basics: Creating, Reading, Writing Files
More Relevant Posts
-
Day 10/100 — Scanner User Input in Java ⌨️ One common issue every Java beginner faces while taking user input using the Scanner class. ⚠️ The nextLine() bug after nextInt() When we use nextInt() and then immediately call nextLine(), the nextLine() may get skipped. This happens because nextInt() does not consume the newline character left in the input buffer. ✔️ Solution: Add an extra sc.nextLine() to clear (flush) the buffer. Example: Scanner sc = new Scanner(System.in); System.out.print("Enter your marks: "); int marks = sc.nextInt(); sc.nextLine(); // flush the leftover newline System.out.print("Enter your name: "); String name = sc.nextLine(); 💻 Challenge I worked on today: Build a simple Report Card program that takes student details and marks using Scanner input. Step by step learning — improving Java fundamentals every single day 🚀 #Java #CoreJava #Scanner #JavaLearning #Programming #100DaysOfCode
To view or add a comment, sign in
-
-
Today I strengthened my understanding of how Java programs actually execute 🚀☕ Here’s what I learned step by step: ✔ The file name must match the public class name 📄 ✔ The main() method can be inside any class, not only the public class 🔍 ✔ Only one public class is allowed in one ".java" file ⚠️ ✔ Protected members outside the package are accessible through inheritance — 🔹 Non-static → accessed using child class object 🔹 Static → accessed using child class name or parent class name inside child class 👨👦✨ ✔ The JVM first loads the class that contains main(), then loads other required classes when needed 🧠 Understanding these core execution rules is helping me build stronger clarity in Java inheritance and access modifiers 💻📚 #Java #Programming #LearningJourney #OOP #JavaDeveloper #BackendDevelopment 🚀
To view or add a comment, sign in
-
♻️ Why should you always close Scanner in Java? Scanner is used to read input, from the console, a file, or a stream. But a lot of beginners (including me, early on) never bother closing it after use. Here's why that's a problem: ->it holds onto system resources even after your program is done with them ->for file-based Scanners, it can lock the file or cause data not to be flushed properly ->in larger programs, unclosed Scanners can quietly lead to resource leaks The fix is simple, either call: ✔️ sc.close() at the end ✔️ or use a try-with-resources block so Java closes it automatically While practicing Java basics, I realized the code worked either way… but one way was responsible, and the other wasn't. That's something no compiler warning will tell you. Writing correct code and writing clean, responsible code are two different things. Learning the difference early makes you a better developer. Learning in public, improving step by step 🤍 #Java #ResourceManagement #LearningInPublic #Programming
To view or add a comment, sign in
-
Functions in Java : part 3 - memoization Hi all, in this third part of the serie we 'll have a look on memoization. Hope you will find it useful. Happy coding PS: github repository address on last slide... #java #functionalprogramming #memoization
To view or add a comment, sign in
-
🚀 Exploring Java Collection Framework Today’s session was all about understanding the powerful Java Collection Framework and how it helps in managing and organizing data efficiently. Dived deep into core concepts like interfaces and classes in collections, and explored the three main interfaces: List, Set, and Map. Gained clarity on how these structures differ and where to use them in real-world applications. Focused on the ArrayList class—its properties like dynamic resizing, ordered storage, and index-based access—making it one of the most commonly used collection classes in Java. Also understood the hierarchy of ArrayList, how it is part of the List interface, and how it inherits behavior from abstract classes like AbstractList and AbstractCollection. 📚 A strong foundation in collections is essential for writing efficient and scalable Java applications. TAP Academy #Java #CollectionsFramework #ArrayList #Programming #LearningJourney #FullStackDevelopment
To view or add a comment, sign in
-
-
💻 Today I learned about Static Methods in Java — and it's simpler (and more powerful) than I thought! Honestly, I used to just copy static methods without really understanding WHY they're static. Today that changed. 😅 🔍 So what's a static method? It belongs to the class itself — not to any object. You call it directly on the class, no new keyword needed. 💡 Key things I picked up: → Static methods can't access instance variables directly → Great for utility/helper functions (think Math.sqrt(), Collections.sort()) → They're loaded into memory when the class loads — before any object exists 📚 Resources I used: → Java Documentation (docs.oracle.com) → W3Schools Java Methods section → Bro Code on YouTube — super beginner-friendly! Small concept, but understanding it properly makes your code so much cleaner. 🙌 Are you learning Java too? What resource helped you the most? Drop it below 👇 #Java #StaticMethods #LearningInPublic #JavaDeveloper #CodeNewbie #Programming #100DaysOfCode #OOP #TechLearning #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 I’ve just published my Java Day 4 article, where I learned one of the most important foundations of Java: Classes and Objects. Until now, my programs were mainly about writing statements, using variables, and getting output. But today, I understood something bigger: how Java programs are actually structured. Here’s what I learned: ✔ A class is a blueprint that defines data and behavior ✔ An object is a real instance created from that class ✔ Classes help organize code, and objects make it practical and usable ✔ This is the core idea behind Object-Oriented Programming in Java Working with classes and objects made my code feel more organized, more meaningful, and closer to how real software is built. This topic also helped me realize that programming is not just about writing lines of code—it is about designing systems in a structured way. #Java #LearningInPublic #BCA #ObjectOrientedProgramming #ProgrammingJourney #BeginnerDeveloper #LearnJava #StudentLife #Day4
To view or add a comment, sign in
-
-
🚀 Day 8/45 – Taking User Input in Java using Scanner On Day 8 of my Java learning journey, I learned how to make programs interactive by taking input from the user. Until now, I was using fixed values in my programs, but today I explored how to accept dynamic input using the Scanner class. 📚 What I Learned Today Today I learned: ✔ How to use the Scanner class from java.util package ✔ Taking input using methods like nextInt(), next(), and nextLine() ✔ Writing programs that respond based on user input 💻 Practice Work To apply my learning, I implemented: • Addition of two numbers using user input • Even or odd number checker using input • Simple interest calculator using user-provided values 🎯 Key Takeaway Taking input from users makes programs dynamic and interactive. This is an important step toward building real-world applications. Practicing daily is helping me improve both my coding and problem-solving skills. #Java #Programming #LearningInPublic #software #CodingJourney #SoftwareDevelopment #Consistency
To view or add a comment, sign in
-
🚀 Day 7/45 – Working with Strings in Java On Day 7 of my Java learning journey, I explored the concept of Strings, which are used to store and manipulate text data in programs. Strings are widely used in almost every application, from user input to data processing. 📚 What I Learned Today Today I learned: ✔ What strings are and how they are created in Java ✔ Important string methods like length(), charAt(), and toUpperCase() ✔ How to compare strings using equals() ✔ Understanding case-sensitive and case-insensitive comparisons 💻 Practice Work To strengthen my understanding, I implemented: • A program to reverse a string • A program to count characters in a string • A palindrome checker using string logic 🎯 Key Takeaway Strings are a fundamental part of programming, and mastering string manipulation is essential for solving real-world problems. Consistent daily practice is helping me build strong fundamentals step by step. #Java #Programming #LearningInPublic #CodingJourney #SoftwareDevelopment #Consistency
To view or add a comment, sign in
-
📚 New article just published on SYUTHD! 🔖 Java 26 vs. Java 25 LTS: Performance Benchmarks and Migration Guide 🏷️ Category: Java Programming 📖 Full article → https://lnkd.in/g-DmkTDW 👉 Follow our page for more tech tutorials: https://lnkd.in/gsJDptPM 💬 Telegram: https://t.me/nisethtechno 👍 Facebook: https://lnkd.in/gsKv3Dyn #JavaProgramming #Tech #Tutorial #Programming #TechBlog #2026
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