Blog Archives

What are good real life Java inheritance (or use of abstract classes) examples ?

We have already looked at Why favor composition over inheritance? with reasoning and code examples. Inheritance still has its use and let’s look at some real life examples. #1. Unit Test Classes

In the base class you can wire up Spring configs, shared logic, etc. For example, you may…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, OOP
Tags:

08: ♦ Write code to add, subtract, multiply, and divide given numbers?

A trivial coding example (i.e. a Calculator) tackled using the following programming paradigms in Java not only to perform well in coding interviews, but also to learn these programming paradigms. Approach 1: Procedural Programming Approaches 2 – 4: Object Oriented Programming Approach 5: Functional Programming (Java 8) Approach 1: Procedural

Read more ›

Posted in Can you write code?, Coding, Java 8, OOP

Explain abstraction, encapsulation, Inheritance, and polymorphism with the given code?

Given code:

A. Firstly, let’s take abstraction and encapsulation as the difference is subtle. Abstraction is often not possible without encapsulation because if a class exposes its internal state, it can’t change its inner workings. Encapsulation hides the underlying state. One of the ways to achieve abstraction is by…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, OOP

Top 5 OOPs tips for Java developers

Tip #1: Tightly encapsulate your classes. A class generally contains data as well as methods, and is responsible for the integrity of its own data. The standard way to protect the data is to make it private, so that no other class can get direct access to it, and then write…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, OOP
Tags:

Understanding Open/Closed Principle (OCP) from the SOLID OO principles with a Java example

Q. Is there anything wrong with the following class design? If yes, can the design be improved?

JUnit test class.

A. It’s not a good idea to try to anticipate changes in requirements ahead of time, but you should focus on writing code that is well written enough…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Design Concepts, member-paid, OOP

♥ Design principles interview questions & answers for Java developers

Q1. What are the SOLID design principles? A1. SOLID is an abbreviation for 5 design principles. SRP (Single Responsibility Principle) If you have a class with calculation logic, validation logic, data access logic and display logic all mixed up then it violates the SRP principle. This makes it difficult to

Read more ›

Posted in Design Concepts, OOP
Tags:

Top 6 tips to go about writing loosely coupled Java applications

Q1. What is tight coupling? A1. If class OrderServiceImpl relies on parts of class PaymentServiceImpl that are not part of class PaymentServiceImpl‘s interface PaymentService, then the OrderServiceImpl and PaymentServiceImpl are said to be tightly coupled. In other words, OrderServiceImpl knows more than what it should about the way in which…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Design Concepts, Judging Experience Interview Q&A, member-paid, OOP
Tags: ,

How to create a well designed Java application?

A software application is built by coupling various classes, modules, and components. Without coupling, you can’t build a software system. But, the software applications are always subject to changes and enhancements. So, you need to build your applications such a way that they can not only adapt to growing requirements,…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Design Concepts, Judging Experience Interview Q&A, member-paid, OOP
Tags:
Page 1 of 212

600+ Java/JEE Interview Q&As

open all | close all

200+ FAQs for Quick Java Interview Prep

open all | close all

16 Technical Key Areas to standout

open all | close all

80+ step by step Tutorials conducive to self-taught projects

open all | close all

100+ pre-interview coding tests

open all | close all

How good are your …..?

open all | close all