Hello guys, it's been a long since I have shared a Java design pattern tutorial. I did share some courses to learn design patterns but haven't really talked about a particular design pattern in depth. So, today, we'll learn one of the important design pattern, which is often overlooked by Java developers. Yes, I am talking about the Command Pattern which can help you write flexible, loosely coupled code for implementing actions and events in your application. In simple words, the command design pattern is used to separate a request for action from the object which actually performs the action. This decoupling between Invoker and Receiver objects provides a uniform way to perform different types of actions. This decoupling is achieved using a Command object, which is usually an interface with methods like execute().
Learn Java, Programming, Spring, Hibernate throw tutorials, examples, and interview questions
Wednesday, June 29, 2022
How to sort an Array in Java? Ascending and Descending Order Example
As a Java programmer, quite often you would need to sort array in Java luckily java.util.Arrays class provides several utility methods to sort an array in Java. You can sort different types of array in Java like array of primitive data types, object or int, String, etc. Arrays are in java.util package and exposed all sorting related methods as static utility functions. you can access sort() as Arrays.sort() and just pass your array and it will sort that array object by comparing them in the order implemented in the compareTo() method if the class implements Comparable interface. You can also sort arrays in ascending order, descending order, or any custom order defined by the custom comparator in Java.
How to loop through an Array in Java? Example Tutorial
Hello there, If you want to loop over an array in Java but not sure how to do that then you have come to the right place. Earlier, I have shared many Java array tutorials and the best Java courses for beginners, and today, I am going to teach you how to iterate over an array in Java. There are multiple ways to loop over an array in Java, like you can use a for loop, an enhanced for loop, a while loop, or a do-while loop. Since while and do-while needs a condition to terminate they often depend upon the content of the array like stop when the current element is null or even or odd etc. If you just want to iterate over an array to access each element like loop over an array and print each entry then you should use either for loop or the enhanced for loop.
How to declare and initialize a List with values in Java (ArrayList/LinkedList) - Arrays.asList() Example
Hello guys, today, I am going to share with you a useful tip to initialize a List like ArrayList or LinkedList with values, which will help you a lot while writing unit tests and prototypes. Initializing a list while declaring is very convenient for quick use, but unfortunately, Java doesn't provide any programming constructs like the collection literals of Scala, but there is a trick which you can use to declare and initialize a List at the same time. This trick is also known as initializing a List with values. I have used this trick a lot while declaring list for unit testing and writing demo programs to understand an API etc and today I'll you'll also learn that.
Tuesday, June 28, 2022
How to implement Skip List in Java? Example Tutorial
Hello friends, we meet again today. hope you all are excited and ready for today's journey. Today, we are gonna learn something that is not very common. It is used not very common, but, if used, it is a great strength to our time complexity reduction. So, what's the wait? Let's start! So, suppose we have a linked list with us which has 10 million records. Now, for searching a particular node, the time taken would be O(N). Where N is the size of the list. Similarly, the time taken for deletion of a Node, Insertion at a particular Node will also take O(N) time. Can we reduce it?
Monday, June 27, 2022
Top 5 Websites to Learn Java Coding for FREE - Best of lot
Hello guys, if you want to learn Java Programming and looking for the best websites to learn Java coding for free then you have come to the right place. In the past, I have shared the best Java courses and books, today, I am going to share free websites to learn Java Programming for free. being the author of a Java blog and programmer I often receive questions like how to improve my coding skills?, or how do I learn to code in Java?, or I am having difficulty solving programming problems, please help, etc. This is mostly from programmers who have just started programming or computer science graduates with a programming degree or even some programmers with a year or two in Job.
Can a Non Static Method Access a Static Variable/Method in Java?
"Can a non-static method access a static variable or call a static method" is one of the frequently asked questions on the static modifier in Java, the answer is, Yes, a non-static method can access a static variable or call a static method in Java. There is no problem with that because of static members i.e. both static variable and static methods belong to a class and can be called from anywhere, depending upon their access modifier. For example, if a static variable is private then it can only be accessed from the class itself, but you can access a public static variable from anywhere.
Sunday, June 26, 2022
How to find If Linked List Contains Loop or Cycle in Java? Example Solution
Write a Java program to check if a linked list is circular or cyclic, and how do you find if a linked list contains
loop or cycles in Java are some common linked list related data structure interview questions
asked in various Java Interviews. This is sometimes asked as a follow-up question
of basic linked list questions like inserting an element at the beginning, middle and
end of a linked list or finding the length of linked list.
In order to solve linked list related algorithmic questions in Java, you need to
be familiar with the concept of singly linked list, doubly linked list, and circular
linked list. Until stated specifically, most questions are based on a singly
linked list. For those who are not familiar with the linked list data structure, its
a collection of nodes.
How to create Tabs UI using HTML, CSS, jQuery, JSP and JavaScript? Example
JSP is still a popular technology for developing view part of Struts and Spring-based Java applications, but unfortunately, it doesn't have rich UI support available in GWT, or any other library. On another day, we had a requirement to display HTML tables inside tabs, basically, we had two tables of different data set and we need to display them in their own tabs. Users can navigate from one tab to another, and CSS should take care of which tab is currently selected, by highlighting the active tab. Like many Java developers, our hands-on HTML, CSS, and JavaScript are a little bit tight than a web guy, and since our application is not using any UI framework, we had to rely on JSP to do this job.
Top 5 books to Learn Object Oriented Programming and Design - Must Read, Best of Lot
The OOP or Object Oriented Programming is one of the most popular programming paradigms which helps you to organize code in the real-world system. It's a tool that allows you to write sophisticated software by thinking in terms of objects and relationships. Unlike its predecessor procedural Programming paradigm, which is implemented most notably by C, which solves the problem and complete task by writing code for computers, the OOP style of programming allows you to think in terms of real-world objects which have both state and behavior. You can view anything as objects and then find their state and behaviors, this will help you to simulate that object in code.
How to use Adapter Design Pattern in Java with Example
The adapter design pattern in Java, also known as the Wrapper pattern is another very useful GOF pattern, which helps to bridge the gap between two classes in Java. As per the list of Gang of Four patterns, the Adapter is a structural pattern, much like Proxy, Flyweight, Facade, and Decorator patterns in Java. As the name suggests, the Adapter allows two classes of a different interface to work together, without changing any code on either side. You can view the Adapter pattern as a central piece of the puzzle, which joins two pieces, which can not be directly joined because of different interfaces.
What is the Use of Interface in Java and Object Oriented Programming? [Answer]
Many times, I have seen questions like why should we use an interface in Java? If we can not define any concrete methods inside the interface the what is the user of the interface? Or even more common, What is the real use of the interface in Java? I can understand beginners asking this question when they just see the name of the method inside the interface and nothing else. It takes time to realize real goodness or actual use of interface or abstraction in Java or any object-oriented programming. One reason for this is a lack of experience in really modeling something real in the program using object-oriented analysis and design. In this article, I will try to answer this question and give you a couple of reasons to use the interface in your code. If you have a good understanding of Object-oriented basics like Polymorphism, then you know that it allows you to write flexible code.
Saturday, June 25, 2022
Difference between Inheritance and Composition in Java and Object Oriented Programming
Though both Inheritance and Composition provide code reusability, the main difference between Composition and Inheritance in Java is that Composition allows reuse of code without extending it but for Inheritance, you must extend the class for any reuse of code or functionality. Another difference that comes from this fact is that by using Composition you can reuse code for even the final class which is not extensible but Inheritance cannot reuse code in such cases. Also by using Composition, you can reuse code from many classes as they are declared as just a member variable, but with Inheritance, you can reuse code from just one class because in Java you can only extend one class because multiple Inheritance is not supported in Java.
Top 6 Courses to Learn Code Refactoring for Experienced Java Programmers in 2024 - Best of Lot
Hello guys, if you want to improve your coding skills, learn to refactor and other coding best practices, and look for the best online courses to improve your coding skills, refactoring, and other best practices, then you have come to the right place. Earlier, I shared the best design pattern courses and best Data Structure and Algorithms courses, and today, I will share the best online courses you can join to improve your coding and programming skills. Coding skill is one of the most important differentiators when it comes to getting a programming job. It's
simple, if you can't code, you can't go up the ladder, and you can't get better jobs.
Thursday, June 23, 2022
Top 6 Free Game Development Courses for Java and Unity Developers in 2024 - Best of Lot
If you are a programmer with a passion for game development or a computer science graduate who wants to become a Game Developer for the console, Android, or iOS device and looking for some excellent courses to start with, then you have come to the right place. In this article, I am going to share some of the best Game Development courses which are entirely free using Unity, Corona, and LibGDX, three of the most popular game engines for Programmers and Game Developers. While LibGDX is Java-based and Unity is C# based but probably the most popular game engine at this moment. Unity Game engine is both powerful and free, which makes it ideal to use for game development. If you don't know, Unity is the same software used to create Pokemon Go and many other best selling mobile games!
Wednesday, June 22, 2022
Top 5 Free iOS App Development Courses for Beginners in 2024 - Best of Lot
If you are thinking to learn iOS App development like developing games and applications for Apple's iOS devices like iPhone and iPad and looking for some free courses then you have come to the right place. In this article, I am going to share five free courses to learn iOS App Development and become the iOS developer you always wanted to be. This is the third article in my series of articles about learning iOS and venturing into app development using Swift. In my previous article, I have shared some of the best-paid courses to learn iOS development you can take to become an iOS developer this year and some free courses to learn Swift Programming language, Apple's own language to create iOS applications.
Top 5 Free Courses to Learn Microsoft SQL Server and T-SQL in 2024 - Best of Lot
Hello there, welcome to my blog. The Microsoft SQL Server is not just one of the popular database solutions but also one of the most complicated software offerings from Microsoft. It requires you to have a foundation in networks, databases, and programming. This wide range of skills is often challenging to obtain without rigorous learning and years of hands-on experience. Since it's difficult to learn and master the demand for expert SQL Server DBAs and Programmers is always high, particularly in the banking sectors. I know many of my friends in London and all around the world become SQL Server DBAs after starting as a programmer just to work on those big banks and earn very high salaries.
Tuesday, June 21, 2022
Top 5 Apache Spark Online Courses in 2024 - Best of Lot
Hello friends, we are here again today for another exciting topic to
discuss. But, today we are not gonna discuss something which is related to
Java or any other language or spring boot. Today we are gonna discuss
something which is immensely practical and has the potential to land you
very high paying jobs. Today we are gonna take a look at the best available Apache Spark courses
online. Apache Spark is one of the most popular Big Data Framework and
powering many companies Big Data processing. Earlier, I have shared the
best courses to learn Hadoop
and
Big Data and many of you asked to share the best courses on Apache Spark so
here we are with the best online courses to learn Apache Spark.
Sunday, June 19, 2022
Top 5 Free Apache Kafka Courses for Beginners in 2024 - Best of Lot
With the new year approaching soon, many of us will be excited about it, as a
new year means a new beginning. For that beginning, some of us have planned some
objectives like working on our physique, learning some new language, learning a
demanding skill to boost our career, or beginning our professional career with
some greatly advancing opportunities. Here, I am presenting you, a very
demanding skill with which many of you are familiar. Apache Kafka, the modern-day advanced analytics chatting service used by big organizations
like Uber, Airbnb & much more to handle thousands of conversations
routinely. It's also one of the essential skills for Java developers and I have
included in my list 22 tech skills for Java developers.
Saturday, June 18, 2022
Top 5 Dart and Flutter Online Courses for Beginners in 2024 - Best of Lot
If you have been following tech development then you know may know that Dart is another programming language created by Google. Along with Golang, Angular, and Flutter, Dart is also incorporates best practices from existing platforms and tries to minimize the friction. Dart was originally launched in 2011 but it really picked up lately. The last few years have seen a phenomenal rise in Dart programming language, mainly because of Flutter, a popular framework from Google for developing cross-platform native mobile applications for Android and iOS platforms. Dart is also one of the most loved programming languages on the StackOverFlow survey and is designed for Developer productivity. It is somewhere between Java and JavaScript.
Thursday, June 16, 2022
java.lang.UnsatisfiedLinkError: no dll in java.library.path - Cause and Solution
"Exception in thread "main" java.lang.UnsatisfiedLinkError: no dll in java.library.path" is one of the frustrating errors you will get if your application is using native libraries like the DLL in Windows or .SO files in Linux. Java loads native libraries at runtime from either PATH environment variable or location specified by java.library.path system property depending upon whether your Java program is using System.load() or java.lang.System.loadLibarray() method to load native libraries. If Java doesn't find them due to any reason it throws "java.lang.UnsatisfiedLinkError: no dll in java.library.path".
Top 10 Blender Online Courses to Learn 3D Modeling in 2024 - Best of Lot
Hello guys, if you want to learn Blender and 3D modeling in 2024 and looking
for the best blender and 3D modeling online courses and other learning
resources then you have come to the right place. In the past, I have shared
the best courses to learn
Unity game engine
and
Unreal engine courses
and in this article, I am going to share the best online courses to learn
Blender and 3D modeling in 2024. When you watch some animated movies and you
see the gorgeous design of the 3D character you may be wondering about how
they design them and what that process is called. Well, it knows as 3D
modeling which is a process that makes the computer create a 3D representation
of those characters or any shape you see that is 3D, like homes cars the
environment, and so on.
Spring Boot Error - Error creating a bean with name 'dataSource' defined in class path resource DataSourceAutoConfiguration
Hello guys, If you are using Spring Boot and getting errors like "Cannot determine embedded database driver class for database type NONE" or "Error creating a bean with name 'dataSource' defined in class path resource ataSourceAutoConfiguration" then you have come to the right place. In this article, we'll examine different scenarios on which this Spring Boot error comes and what you can do to solve them. The general reason for this error is Spring Boot's auto-configuration, which is trying to automatically configure a DataSource for you but doesn't have enough information. It is automatically trying to create an instance of DataSourceAutoConfiguration bean and it's failing.
Difference between WHERE vs HAVING clause in SQL - GROUP BY Comparison with Example
What is the difference between WHERE and HAVING clause in SQL is one of the most popular questions asked on SQL and database interviews, especially to beginners? Since programming jobs, required more than one skill, it’s quite common to see a couple of SQL Interview questions in Java and .NET interviews. By the way unlike any other question, not many Java programmers or dot net developers, who are supposed to have knowledge of basic SQL, fail to answer this question. Though almost half of the programmer says that WHERE is used in any SELECT query, while HAVING clause is only used in SELECT queries, which contains aggregate function or group by clause, which is correct.
Tuesday, June 14, 2022
Top 5 Online Courses for Content Creators and Instructors in 2024 - Best of Lot
There is something about content creation like online training courses that makes learning so easy. They are affordable, convenient, and accessible everywhere. More and more programmers, bloggers, and experts are now teaching online so that now there are so many high-quality courses available on the internet to learn almost anything. It wasn't like that a couple of years ago when books and tutorials were the primary resources for learning new skills, but there is a huge potential still for both learners and creators when it comes to creating and selling online courses. You can easily make 10K USD per month by selling online courses and more importantly can make a difference in people's life.
Why Programmers & Software Engineers Should Create Online Courses in 2024? [Side Project]
I often receive queries like should programmers create an alternative source of income, or should programmers create their own blog or website? Both are fundamental questions, and there was a time when I advise programmers to create their own blog, not just to learn and improve their understanding of the technology they know, but also to earn money while doing things they love, but time has changed. Now I advise Programmers and Software Developers to create and sell online courses on Teachable, Thinkific, Podia, Udemy, or any other platforms. The reasons are still the same, you learn and earn, but the method has been changed. A blog is always an excellent way to establish yourself online, but it requires a lot more effort and time to earn something meaningful.
Wednesday, June 8, 2022
Top 5 Free Online Courses to learn Linux and Ubuntu in 2024 - Best of Lot
Hello guys, if you want to learn Linux and Ubuntu Operating system in 2024 and looking for the best resources like books, online courses, and tutorials then you have come to the right place. Earlier, I have shared the best Kali Linux courses, websites, and books and in this article, I am going to share free online courses to learn
both Ubuntu and Linux online. Ubuntu is without a doubt one of the most widely used operating systems
for server-side applications. Except for a number of Java apps that run on
Windows as a service, I've seen practically all Java applications run on Linux.
Tuesday, June 7, 2022
Why Java Programmers Should Learn Docker and Kubernetes in 2024
Hello Java Programmers, if you are looking to learn some in-demand software tools to improve your profile, then you have come to the right place. Earlier, I have shared the best tools for Java developers, and today, I am extending it to all developers. long with Docker, if there is another tool or technology which has caught software developers' attention in recent times then it must be Kubernetes. Actually, it's often mentioned alongside Docker because it takes what Docker offers to the next level. If you don't know what is Docker and Kubernetes let me give you a brief overview before going deep into why every programmer should learn Kubernetes. In simple words, Docker is a container and Kubernetes is a container orchestration tool, something which can do creating, destroying, and managing containers at scale.
Sunday, June 5, 2022
10 Reasons to Learn Scala Programming Language in 2024 [UPDATED]
One of the questions my reader often ask me is, should Java developers learn Scala? Does Scala has a better future than Java, or why Java developer should learn Scala, and so on. Well, there can be many reasons for learning Scala, like you are forced to learn because it has been used in the new company you joined or your solution architect decided to use it, but that's a different story. Here, we'll talk about the reasons which encourage Java developers to learn Scala. Scala has emerged as one of the most powerful Java alternatives in recent times. It's been the JVM language of choice, leaving Groovy and Clojure way behind, and preferred as the language people want to write most code in.
Top 5 Free Agile Courses for Programmers and Software Engineers in 2024 - Best of Lot
Technology is changing at a rapid pace and market conditions, tough competition, and time-to-market are some of the biggest concerns for today's organizations, especially for technology companies. In order to adapt to this fast-changing environment, most companies are now using the Agile model of development, testing, and project management. This enables the organizations to efficiently cope with changes and deliver faster and that's why for a programmer or an IT professional, a solid knowledge of Agile methodologies and framework is important. It doesn't matter whether you know the Waterfall model of development or not but it does matter whether you have worked in an Agile environment or not. In order to educate programmers about Agile, I have shared some of the books to learn Agile in past and today I am going to share some of the free online Agile courses you can take to learn Agile methodologies at your own pace.
Top 5 Free C programming Courses for Beginners to Learn Online in 2024 - Best of Lot
Hello guys, if you are learning C programming and looking for the best resources like online courses and books then you have come to the right place. In the last article, I have shared the best courses to learn C programming and in this article, I am going to share the best free C programming courses for beginners. C is one of the first programming language I learned and it's also one of the first major programming languages is taught in Academics but it's also one of the popular programming languages of the software industry. The majority of JVMs and compilers are written in C. C has influenced the development of several other programming languages.
Wednesday, June 1, 2022
How to Design Vending Machine in Java - Part 2 [Object Oriented Design Problem with Solution]
This is the second part of the Java tutorial to show how to design Vending Machine in Java. In the first part, we have discussed the problem statement and the solution itself, but unit testing and design document were still pending, which we'll see in this article. As I said, there are multiple ways to design a Vending machine in Java, for example, you could have easily used state design patterns to implement a vending machine, in fact, it's one of the best examples of State design patterns. Vending machine behaves differently in different states like return a product if the machine is not empty, otherwise, it just returns coins, so it ideally fits in the state design pattern.
10 Reasons to Learn Python Programming Language in 2024
If you are a regular reader of this blog, then you may be wondering why am I writing a blog post to tell people to learn Python in a Java blog? Didn't I ask you to prefer Java over Python a couple of years ago? Well, things have changed a lot since then. In 2016, Python replaced Java as the most popular language in colleges and universities, and since then, it has never looked back. Python is growing and growing big time. If you read programming and technology news or blog post, then you might have noticed the rise of Python as many popular developer communities, including StackOverflow and CodeCademy has mentioned the growth of Python as a dominant programming language.