In modern web development, there is an increasing demand for creating web applications that are responsive, scalable, and easily maintainable. To achieve these goals, software developers often rely on software design patterns, which provide a proven set of principles and best practices for building robust software applications. One such pattern is the Backend for Frontend (BFF) pattern, which is a design pattern used in the development of web applications. In this article, we will explore the BFF pattern in detail, including how it works and why it is useful.
Thursday, June 29, 2023
Monday, June 26, 2023
10 Reasons to Reconsider Microservices For Your Next Project
Hello guys, in recent years, microservices architecture has gained significant popularity among developers and organizations seeking to build scalable and modular systems. However, it's crucial to recognize that while Microservices offer numerous benefits, they may not be the ideal solution for every situation. Yes, you heard it right, monolithic or SOA can still be more suitable than Microservices in many situation. For example, if you are developing a latency sensitive application then monolithic architecture is much better than Microservices. While that is a one of the special scenario, this article aims to provide a balanced perspective by outlining ten reasons to reconsider the adoption of microservices. This is also one of the popular Microservice interview questions so not just knowing why use Microservices its also make sense to know why you should not use them.
Labels:
microservices
Friday, May 26, 2023
What is Daemon thread in Java and Difference to Non daemon thread - Tutorial Example
Daemon thread in Java is those thread that runs in the background and is mostly created by JVM for performing background tasks like Garbage collection and other housekeeping tasks. The difference between Daemon and Non-Daemon (User Threads) is also an interesting multi-threading interview question, which is asked mostly on fresher level java interviews. In one line main difference between daemon thread and user thread is that as soon as all user threads finish execution java program or JVM terminates itself, JVM doesn't wait for daemon thread to finish their execution.
How to use Fork Join in Java Multithreading - Tutorial with Example
What is fork Join framework in Java: Already popular project coin of JDK7 release has presented a lot of good features e.g automatic resource management, string in switch case, better exception handling in JDK7, etc. Another important feature to note is fork-join as the name implies it divides one task into several small tasks as a new fork means child and joins all the forks when all the sub-tasks are complete.
Labels:
core java
,
Java 7
,
Java multithreading Tutorials
What is Phaser in Java? When and How to use Phaser? Example Tutorial
Hello guys, if you want to know what is Phaser and when and how to use Phaser in Java then you have come to the right place. Phaser in Java is a synchronization mechanism introduced in Java 7 that allows threads to wait for a certain phase or a set of phases to complete before proceeding further. It is a reusable barrier that allows threads to synchronize and wait for other threads to reach a certain phase before moving ahead. In the past, I have shared the best Concurrency courses and books and also wrote tutorials about popular Java concurrency utility classes like CyclicBarrier, CountDownLatch, BlockingQueue, ForkJoinPool, and recently CompletableFuture in this article, you will learn about Phaser, another useful concurrency utility for Java programmers.
Labels:
concurrency
,
Java multithreading Tutorials
,
Phaser
Thursday, May 25, 2023
Difference between final, finally and finalize method in Java
What is the difference between the final, finally, and finalize method is asked to my friend in a Java interview with one of the US-based Investment banks. Though it was just a telephonic round interview, he was asked a couple of good questions e.g. how to avoid deadlock in Java, How to get() method of HashMap works, and one of the puzzles which are based on recursion. In short final keyword can be used along with variable, method, and class and has a different meaning for all of them. finally is another Java keyword is used in Exception handling along with try, catch, throw, and throws. finalize() is a special method in Java that is called by Garbage Collector before reclaiming GC eligible objects.
Labels:
core java
,
core java interview question
Difference between private, protected, public and package modifier or keyword in Java
private vs public vs protected vs package in Java
Java has four access modifiers namely private, protected, and public. package level access is the default access level provided by Java if no access modifier is specified. These access modifiers are used to restrict the accessibility of a class, method, or variable on which it applies. We will start from the private access modifier which is the most restrictive access modifier and then go towards the public which is the least restrictive access modifier, along the way we will see some best practices while using access modifier in Java and some examples of using private and protected keywords.
Labels:
core java
,
core java interview question
Difference between static vs non static method in Java - Example
In this article, we will take a look at the difference between the static and non-static methods in Java, one of the frequently asked doubts from Java beginners. In fact, understanding static keyword itself is one of the main programming fundamentals, thankfully it's well defined in the Java programming language. A static method in Java belongs to the class, which means you can call that method by using class name e.g. Arrays.equals(), you don't need to create an object to access this method, which is what you need to do to access non-static method of a class.
Difference between Class and Object in Java and OOP with Example
Class and Object are the two most important concepts of Object-oriented
programming language (OOPS) e.g. Java. The main difference between a Class and an Object in Java is that class
is a blueprint to create different objects of the same type. This may look
simple to many of you but if you are a beginner or just heard the term Object
Oriented Programming language might not be that simple. I have met many
students, beginners, and programmers who don’t know the difference between class and
object and often used them interchangeably.
Labels:
core java
,
object oriented programming
Difference between Abstract Class vs Interface in Java
When to use interface and abstract class is one of the most popular object-oriented design questions and is almost always asked in Java, C#, and C++ interviews. In this article, we will mostly talk in the context of the Java programming language, but it equally applies to other languages as well. The question usually starts with a difference between abstract class and interface in Java, which is rather easy to answer, especially if you are familiar with the syntax of the Java interface and abstract class. Things start getting difficult when the interviewer asks about when to use abstract class and interface in Java, which is mostly based upon a solid understanding of popular OOPS concepts like Polymorphism, Encapsulation, Abstraction, Inheritance, and Composition.
Difference between valueOf and parseInt method in Java? Example
Both valueOf and parseInt methods
are used to convert String to Integer in Java, but there is subtle differences
between them. If you look at the code of valueOf() method, you
will find that internally it calls parseInt() method to convert String to Integer, but
it also maintains a pool of Integers from -128 to 127 and if the requested integer
is in the pool, it returns an object from the pool. This means two integer objects
returned using the valueOf() method can be the same by the equality operator. This
caching of Immutable object, does help in
reducing garbage and help garbage collectors.
Labels:
coding
,
core java
,
Java Programming Tutorials
What is difference between java.sql.Time, java.sql.Timestamp and java.sql.Date - JDBC interview Question
Difference between java.sql.Time, java.sql.Timestamp and java.sql.Date is the most common JDBC question appearing on many core Java interviews. As JDBC
provides three classes java.sql.Date, java.sql.Time and java.sql.Timestamp to
represent date and time and you already have java.util.Date which can
represent both date and time, this question poses a lot of confusion among Java
programmer and that’s why this is one of those tricky
Java questions are tough to answer. It becomes really tough if the differences between them are not understood correctly.
Labels:
core java
,
core java interview question
,
JDBC
,
programming
,
SQL
Wednesday, May 24, 2023
How to check File Permission in Java with Example - Java IO Tutorial
Java provides several methods to check file and directory permissions. In the last couple of articles, we have seen how to create Files in java and how to read a text file in Java, and in this article, we will learn how to check whether the file is read-only, whether the file has to write permission or not, etc. In Java we know we have a file object to deal with Files if we have created any file in our application using the file object, we have the privilege to check the access permission of that file using a simple method of File class in Java. Let see what the methods are and how to use that method
Labels:
core java
,
Java File Tutorial
,
java IO tutorial
How to Change File Permissions in Java – Example Tutorial
Hello guys, In the last article, we saw how to check whether an application can access the file and perform any read-write or execute an operation on that file by using the inbuilt method provided by File Object. Now we deal with some more methods of file class which will use to provide some privileges to users so that they can perform read, write, and execute operations on the particular file. There are few more methods added with the new File API in Java 7, but in this tutorial, we will only learn about traditional ways to change the permission of a file from the Java program, which should work on all versions of JDK.
Labels:
core java
,
Java File Tutorial
,
java IO tutorial
Java Serialization Example - How to Serialize and Deserialize Objects in Java?Tutorial
Serialization is one of the important but confusing concepts in Java. Even experienced Java developers struggle to implement Serialization correctly. The Serialisation mechanism is provided by Java to save and restore the state of an object programmatically. Java provides two classes Serializable and Externalizable in java.io package to facilitate this process, both are marker interfaces i.e. an interface without any methods. Serializing an Object in Java means converting it into a wire format so that you can either persist its state in a file locally or transfer it to another client via the network, hence it becomes an extremely important concept in distributed applications running across several JVMs.
Labels:
core java
,
Java Serialization Tutorial
Subscribe to:
Posts
(
Atom
)