🔖If a user defines a constructor( ), the JVM stops providing the default (no-arg) constructor. Now, object creation must use the user-defined constructor only. 🔖Frontlines EduTech (FLM) #Java #OOPS #CoreJava #Constructors #JavaBasics
Java Constructor Basics: No-Arg Constructor
More Relevant Posts
-
Feature Envy is a subtle code smell where methods are more interested in another class's data than their own. Here's how Move Method refactoring can transform your code. The key is moving methods to the classes that contain the data they operate on most frequently. Key takeaway: Move Method refactoring improves code quality by improving encapsulation and reducing coupling between classes. What's your experience with refactoring Feature Envy? Share your favorite techniques in the comments. #CleanCode #Refactoring #Java #FeatureEnvy #DeveloperTips https://lnkd.in/g3-ibGqy
To view or add a comment, sign in
-
-
Testing patterns often reflect the structure they’re applied to. When tests feel fragile, the architecture is usually part of the story. #CleanArchitectureSeries #SpringBoot #SoftwareArchitecture #Java
To view or add a comment, sign in
-
Dependency Injection — Don’t Create Dependencies Dependency Injection helps decouple your code by injecting dependencies from the outside instead of creating them internally. Instead of hard-coding implementations: - Depend on interfaces - Let a container resolve dependencies - Swap implementations without changing business logic This results in: ✔ Loosely coupled code ✔ Easier testing ✔ Cleaner architecture Don’t create dependencies. Inject them. #DependencyInjection #CleanCode #SoftwareArchitecture #SOLID #DotNet #Java #BackendDevelopment
To view or add a comment, sign in
-
-
🚀 SPRING BOOT ANNOTATIONS – YOU MUST KNOW Spring Boot annotations simplify configuration, improve readability, and help us build production-ready applications faster. This infographic covers the most commonly used annotations across: •Application Bootstrapping •Component & Layer Architecture •Dependency Injection •Web & REST APIs •Database & JPA •Validation & Exception Handling •Security •Scheduling, Async & Caching If you’re preparing for Java / Spring Boot interviews or building real-world projects, mastering these annotations is a must 💡 📌 Save this post for quick revision 📌 Share with someone learning Spring Boot #SpringBoot #Java #BackendDevelopment #RESTAPI #JPA #Hibernate #SpringSecurity #JavaDeveloper #Coding #TechLearning
To view or add a comment, sign in
-
-
🚫 Returning JPA Entities directly from a Spring Boot controller is convenient… until it breaks in production. Here’s why I prefer DTOs over Entities in REST APIs: - Entities are built for persistence (relationships, lazy loading, JPA annotations) — not for API responses. - Returning Entities can trigger serialization issues like `LazyInitializationException` when Jackson touches lazy fields. - Entities may accidentally expose internal/sensitive fields (passwords, roles, audit columns). - DTOs keep the API contract stable even when the database model changes. Quick example: // DTO public record UserDto(Long id, String name, String email) {} // Controller @GetMapping("/users/{id}") public UserDto getUser(@PathVariable Long id) { User user = userService.getUser(id); return new UserDto(user.getId(), user.getName(), user.getEmail()); } Do you currently return Entities directly from Controllers, or are you mapping to DTOs already? #Java #SpringBoot #ReactJS #FullStack #Coding #BackendDevelopment #RESTAPI
To view or add a comment, sign in
-
𝗟𝗟𝗗 𝗦𝗲𝗿𝗶𝗲𝘀 - 𝗣𝗼𝘀𝘁 𝟬𝟲 Your code works. Until one dependency changes and everything breaks. That’s tight coupling. 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 𝗜𝗻𝘃𝗲𝗿𝘀𝗶𝗼𝗻 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲 (𝗗𝗜𝗣) 𝘀𝗮𝘆𝘀: 👉 Depend on 𝗮𝗯𝘀𝘁𝗿𝗮𝗰𝘁𝗶𝗼𝗻𝘀, not concrete implementations. When high-level logic depends on details, change becomes expensive. DIP flips that dependency - and systems become flexible, testable, and scalable. 📘 Full article on Medium (link in comments) #SOLID #DIP #LowLevelDesign #Java #SoftwareDesign #CleanCode
To view or add a comment, sign in
-
Deep in the weeds of refactoring this project into a modular, port-and-adapter structure. Moving the persistence logic into dedicated adapters has already made unit testing the domain a breeze. Current state: ✅ Domain models isolated ✅ Use cases defined ✅ Persistence adapters implemented The goal: A codebase that is as easy to read as it is to run. #DeveloperLife #SoftwareDesign #Java #Kotlin #BuildInPublic
To view or add a comment, sign in
-
-
Abstraction is often explained as “use interfaces” or “hide implementation details.” In real systems, that understanding usually creates more layers, not more clarity. Abstraction is about what clients are allowed to depend on, how change is isolated, and why dependency direction matters. This document captures how I now think about Abstraction — as a way to stabilize systems, and why leaking details silently breaks SOLID. #SoftwareDesign #OOP #BackendEngineering #CleanCode #Abstraction #Java
To view or add a comment, sign in
-
Recently, I integrated Java Virtual Threads (Project Loom) into my backend project to handle high-concurrency I/O operations more efficiently. 🔧 What I changed: • Replaced traditional thread pools with Virtual Threads • Used Executors.newVirtualThreadPerTaskExecutor() for async processing • Kept the code synchronous and clean, without reactive complexity 📈 Impact: • Better scalability for concurrent API calls • Reduced thread management overhead • Improved performance for I/O-heavy flows • Cleaner and more maintainable code 💡 Virtual Threads allowed me to scale without rewriting logic into complex async/reactive patterns. A simple change with powerful results! #Java #VirtualThreads #ProjectLoom #SpringBoot #BackendEngineering #Microservices
To view or add a comment, sign in
-
✅ Can we overload main()? YES ✅ ✅ You can overload main() in Java But ⚠️ JVM runs only, execute this one 👇: ✅ public static void main(String[] args) 🔥 Other main() methods will run ONLY if you call them manually ✅ JVM runs only String[] version, if it is removed, the java run option disappears Other mains run only when you call them 👉 You can overload main(), but JVM executes only main(String[] args) 🔖Frontlines EduTech (FLM) #Java #CoreJava #OOPS #Polymorphism #MethodOverloading #CompileTimePolymorphism #ConstructorOverloading #JVM #JavaDeveloper #FullStackDeveloper #LearningInPublic #mainOverloading
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