📘 Day 2: Object Orientation (OOP Concepts) Object Orientation is all about viewing the world as a collection of objects. 🔹 Everything in Java is treated as an object 🔹 Each object belongs to a class • Class → Blueprint (imaginary) • Object → Real-world entity 🔹 Objects have: • State(attributes) • Behavior(methods) Objects are created using the new keyword, while the JVM manages memory allocation behind the scenes. 📘 Day 3: The "main" Method The main method is the entry point of every Java program. The Operating System starts program execution from here. 🔹 Syntax: "public static void main(String[] args)" 🔹 Breakdown: ✔ public – Accessible to the OS ✔ static– No object needed ✔ void – No return value ✔ main– Recognized by JVM ✔ String[] args– Command-line arguments ✨ In short: Object-Oriented concepts + Main method = Strong foundation of Java programming #Java #ObjectOrientedProgramming #MainMethod #JavaFullStack #CodingJourney #TAPACADEMY #SoftwareDevelopment #Programming #TechLearning #JVM
Java OOP Concepts & Main Method Essentials
More Relevant Posts
-
📁 File Handling 🌊ByteStreams = flow of data as bytes 👉 Byte streams handle raw bytes 🧱 👉 FileInputStream → read 📥 👉 FileOutputStream → write 📤 👉 read() returns -1 at EOF 🛑EndOfFile 👉 Temp variable avoids skipping bytes 🔁 👉 String ➝ getBytes() → byte[] 🔄 👉 Append mode using true ➕ • read() returns 0–255 or -1, so return type is int • int -1 allows JVM to safely signal EndOfFile 🧠 java.io.File 📦 is the package that imports File Class ⚠️ Why try-catch exists • Files live outside JVM 💽 • JVM can’t guarantee file exists, path is valid, or permission is granted 🚫 • So Java forces you to handle risk using checked exceptions 🛡️ • Byte streams → raw data 🧱 • Character streams → text + encoding 📝 👉 Byte streams move raw bytes between JVM and external systems of any format Byte streams deal with bytes, character streams deal with characters using encoding. GitHub Link: https://lnkd.in/eur5pBx4 🔖Frontlines EduTech (FLM) #Java #FileHandling #Streams #BackendDevelopment #JVM #LearningInPublic #ResourceManagement #AustraliaJobs #SwitzerlandJobs #NewZealandJobs #USJobs #BackendDevelopment #Programming
To view or add a comment, sign in
-
-
Day 18 : looping statement A statements are used to execute some set of instructions repeatedly is called a looping statement. we can iterate loop desired number of time based on requirement. In java 4 types of loops 1.for loop 2.while loop 3. do-while loop 4.for each loop or enhance for loop loops has 3 part ie. initialization, condition , updation. for each loop doesn't contain this parts. for loop: A statements are used to execute some set of instructions repeatedly. used when we know the number of iterations. In this loop first we initialize a variable then give a condition and the updation statement if we doens't specify the condition by default jvm adds true then loop goes infinite. Syntax. for(initialization; Condition; updation){ // Statement } ex. for(int i=1;i<=10;i++){ s.o.p(i); } while loop: used to execute some set of instructions repeatedly. We use while loop when we don’t know the number of iterations Initialization, condition and updation are not declared at the same line. It throws a compile time error if we are not specifying the condition. syntax: initialization; while(condition){ // statements; updation; } ex. int a =1; while(a<=10){ s.o.p("hello "+a); a++; } #corejava #java #loop #forloop #whileloop
To view or add a comment, sign in
-
-
Headline: Visualizing the Flow: How getClass() and getName() Work in Java I recently mapped out the internal process of retrieving class information in Java to better understand how objects interact with their metadata. The Flow Breakdown: Student Object: This is the live instance containing actual data (e.g., id = 101, name = Vishal). .getClass(): Calling this on the object returns the Class Object. This is not the data itself, but the Metadata (the blueprint/information) of the Student class. .getName(): When called on the Metadata object, it returns the Fully Qualified Name of the class as a String (e.g., "Student"). Key Takeaway: The getClass() method is the entry point to Reflection in Java. It allows the program to inspect its own structure at runtime by accessing metadata rather than the instance data. #Java #Programming #BackendDevelopment #SoftwareEngineering #JavaReflection #CodingTips
To view or add a comment, sign in
-
-
Advanced Java – Day 1 Day 1 was less about “advanced” stuff and more about getting into the core •Revisited the basics that actually matter: •How Java works internally (source code ➡️ bytecode ➡️JVM) •Why Java is platform independent •Difference between JDK, JRE, and JVM •Primitive vs non-primitive data types •Core OOP concepts like class, object, encapsulation, abstraction, and polymorphism •How memory works (stack, heap, static, string pool) I also practised these concepts by building a simple calculator program to understand how logic, methods, and objects actually come together and a constrain based if-else problem. Seeing it run made things clearer. Looking forward to learning more step by step. #Java #LearningInPublic #AdvancedJava #ProgrammingBasics #StudentLife #Consistency
To view or add a comment, sign in
-
-
📘 Object Oriented Programming (OOP) – Java | Day 4 📅 08/01/2026 Today I revised the core fundamentals of Object Oriented Programming (OOP) in Java and converted my handwritten notes into a clean visual format ✨ Here’s a quick summary of what I learned 👇 🔹 Object Orientation Representing real-world things as objects with: - Properties (HAS) - Behaviors (DOES) 🔹 Real-world Example – Car 🚗 - Properties: Name, Color, Cost, Mileage - Behaviors: start(), accelerate(), stop() 🔹 Class vs Object - Class → Blueprint / Design (Imaginary) - Object → Real-world entity 🔹 Rules of Object Orientation ✔ World is a collection of objects ✔ Every object belongs to a class ✔ Every object has State & Behavior 🔹 One Class → Many Objects All objects share the same structure, but each object has its own data & memory. 🔹 JVM (Java Virtual Machine) - Converts bytecode into machine-level code - Creates objects in Heap Memory using "new" keyword Building strong foundations in Java, one concept at a time 🚀 Learning in public to stay consistent and grow better every day. #Java #OOP #CoreJava #JVM #Programming #LearningInPublic #FullStackDeveloper #JavaDeveloper
To view or add a comment, sign in
-
-
Finished working through Arrays & ArrayLists today. This module felt like the point where coding stopped being about Java syntax and started being about how to think. What arrays actually taught me: - indices matter more than the values themselves - in-place operations need careful planning - small boundary mistakes break logic completely - many problems are solved by reusing a few core patterns - breaking a problem into steps makes it manageable - optimization only makes sense after correctness Working with ArrayLists alongside arrays also made the trade-offs clearer — convenience vs control. Problems like rotation, sorting with pointers, and finding missing elements forced me to slow down and reason instead of guessing. This module made me more comfortable with problem-solving and showed me where I still need practice. Moving forward with a better foundation. #Java #DSA #Arrays #LearningInPublic #ProblemSolving #CodingJourney #JavaDeveloper
To view or add a comment, sign in
-
While solving a problem thought of how JVM executes our code. So went through it and posting here in simple steps! 🔹 Step 1: Compilation Your .java file is compiled into .class files (bytecode) by the Java Compiler (javac). 🔹 Step 2: Class Loading The ClassLoader loads the bytecode into memory—first checking if classes are already loaded, ensuring efficiency and security. 🔹 Step 3: Bytecode Verification The JVM verifies the bytecode for safety—no illegal code, no access violations, ensuring a secure runtime environment. 🔹 Step 4: Interpretation & JIT Compilation · The Interpreter executes bytecode line by line. · Frequently used code is handed to the JIT Compiler, which converts it into native machine code for faster execution. 🔹 Step 5: Runtime Execution The JVM Runtime handles memory management (Garbage Collection), thread management, and system calls while your program runs. 🔹 Step 6: Garbage Collection Automatic memory cleanup! Unused objects are removed, helping prevent memory leaks and optimizing performance. 💡 In short: Java Code → Bytecode → Load → Verify → Interpret/JIT → Run → Manage Memory ✅ Understanding the JVM not only makes you a better developer but also helps you write optimized, scalable Java applications! Have you explored JVM internals or tuned performance using JVM flags? Share your experiences below! 👇 #Java #JVM #SoftwareDevelopment #Programming #Bytecode #Performance #Coding #TechExplained #Developer
To view or add a comment, sign in
-
-
Day 10/25 – LeetCode Challenge 🚀 🔸Problem: Add Strings 🔸Difficulty: Easy 🔸Topic: String, Math 🔸Language: Java Approach 🛠️: ▫️Converted both numeric strings into BigInteger objects. ▫️Used built-in addition to compute the sum safely for large values. ▫️Converted the resulting BigInteger back into a string. ▫️This avoids manual digit-by-digit addition logic. ▫️Efficient for handling very large numbers represented as strings. Key Learnings📚: 🔹Handling large numbers beyond primitive data type limits 🔹Working with string-based numeric inputs 🔹Using Java libraries for precise arithmetic 🔹Understanding constraints vs practical solutions
To view or add a comment, sign in
-
-
A class is only a blueprint. It becomes powerful when you create an 𝗼𝗯𝗷𝗲𝗰𝘁. When you write: 𝐂𝐚𝐫 𝐦𝐲𝐂𝐚𝐫 = 𝐧𝐞𝐰 𝐂𝐚𝐫(); Something important happens. You’re not just declaring a variable. You’re allocating memory on the heap and creating a real instance of that blueprint. This introduces one of the most important concepts in Java: 𝐑𝐞𝐟𝐞𝐫𝐞𝐧𝐜𝐞 𝐯𝐬 𝐎𝐛𝐣𝐞𝐜𝐭 • 𝐂𝐚𝐫 𝐦𝐲𝐂𝐚𝐫 → reference (lives on the stack) • 𝐧𝐞𝐰 𝐂𝐚𝐫() → actual object (lives on the heap) The reference doesn’t contain the object. It points to it. That distinction explains: • Why multiple variables can reference the same object • Why 𝐧𝐮𝐥𝐥 causes runtime errors • Why object comparison can be tricky Today was about: • Understanding how objects are created • What the 𝐧𝐞𝐰 keyword really does • The difference between stack and heap memory Once you understand references, Java stops feeling magical — and starts feeling logical. #Java #OOP #MemoryManagement #Programming #SoftwareEngineering #LearningInPublic
To view or add a comment, sign in
-
-
Day25 - LeetCode Journey Solved LeetCode 344: Reverse String in Java ✅ This was a simple problem on the surface, but it perfectly highlights how powerful clean logic can be. The goal was to reverse a string in-place using O(1) extra space, which means no extra arrays and no shortcuts. Just pure two-pointer logic. Using the left and right pointers and swapping characters step by step felt very satisfying. It’s one of those patterns that looks small but appears everywhere in interviews and real-world problems. Mastering this makes many string and array problems much easier later on. What I liked about this problem is how it teaches efficiency. Instead of creating new memory, we directly modify the existing array. That mindset of optimizing space is extremely important in DSA. Key takeaways: • Strong practice of the two-pointer technique • In-place operations with constant extra space • Clean and readable swapping logic • Reinforced fundamentals of string manipulation ✅ Accepted successfully ✅ 0 ms runtime with optimal performance Sometimes the simplest problems build the strongest foundations. Consistency with basics is what makes complex problems feel easier later 💪 #LeetCode #DSA #Java #Strings #ProblemSolving #Algorithms #CodingJourney #InterviewPreparation #TwoPointers #Consistency #DailyPractice
To view or add a comment, sign in
-
Explore related topics
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