Conducting an Interview is not cheap and costs both time and money to a company. It takes a lot of time to find the right candidate for a job from the 100s resume you receive from consultants and agents. They will always tell you that this guy is a Java Guru, this one is SQL Expert and the next one is the full stack developer you are looking for. If you have to trust them blindly and invite all of them for face-to-face interviews, you are going to be disappointed. One of the first things you should do is to filter candidates who claim to have certain skills like SQL but don't have them, the faster you can weed out those candidates the cheaper will be the hiring process.
Thursday, July 27, 2023
10 Examples of cURL command in UNIX and Linux
Hello guys, if you want to learn about the cURL command and looking for an awesome, hands-on tutorial then you have come to the right place. Earlier, I have shared many examples based tutorials to learn many essential Linux commands find, grep, lsof, and chmod command and in this article, I am going to share 10 examples of curl command in Linux. The curl is one of the essential commands to send HTTP requests from UNIX and Linux operating systems. curl command is part of the cURL package and it's not just useful to send HTTP requests but also allows you to transfer files using FTP and send mail using SMTP.
10 examples of grep command in UNIX and Linux
Hello guys, if you want to learn the grep command in Linux and looking for some awesome, hands-on, easy to use tutorial then you have come to the right place. Earlier, I have shared many examples based tutorials to learn essential Linux commands like find, lsof, curl, sed, and chmod command and in this article, I am going to share 10 examples of grep command in Linux. The grep command is one of the most frequently used UNIX command stands for "Global Regular Expression Print" along with find, chmod, and tar command in UNIX. grep command in Unix operating systems like Linux, Solaris, BSD, Ubuntu, or IBM AIX is used to search files for matching patterns.
Wednesday, July 26, 2023
Difference between Factory and Abstract Factory Design Pattern in Java? Example
Both the Abstract Factory and Factory design pattern are creational design
pattern and use to decouple clients from creating objects they need, But there
is a significant difference between Factory and Abstract Factory design patterns,
Factory
design pattern produces implementation of Products like Garment Factory produce
different kinds of clothes, On the other hand, Abstract Factory design pattern
adds another layer of abstraction
over Factory Pattern and Abstract Factory implementation itself like the AbstractFactory will allow you to choose a particular Factory implementation based upon
need which will then produce different kinds of products.
Labels:
core java
,
core java interview question
,
design patterns
How to install Maven on Windows? Example
There is no difference in installing Maven on Windows7, Windows 8, Windows 8.1, or Windows 10, you can follow the same steps to install Maven in any version of the Windows operating system. Installing Maven is very easy, just download the Apache Maven ZIP file from the Apache Maven Project website (https://maven.apache.org/download.cgi). You can download the apache-maven-3.3.9-bin.zip for using Maven on your 64-bit Windows machine. Remember, Maven 3.3 requires JDK 1.7 or above to run, so make sure you already installed JDK 7 or JDK8. Once you download the binary distribution of Maven, half of the job is down.
Labels:
Maven
Why use Log4j logging vs System.out.println in Java? Answer
Printing messages to the console is an integral part of the development, testing, and debugging of a Java program. If you are working on a Server-side application, where you can not see what's going on inside the server, your only visibility tool is a log file; without logs, you can not do any debugging or see what's going on inside your application. Though, Java has a pretty handy System.out.println() method to print something on the console, which can also be routed to log file but not sufficient for a real-world Java application.
Labels:
best of javarevisited
,
core java
,
logging
Difference between float and double variable in Java? Example
Though both float and double datatype are used to represent floating-point numbers in Java, a double data type is more precise than float. A double variable can provide precision up to 15 to 16 decimal points as compared to float precision of 6 to 7 decimal digits. Another significant difference between float and double is their storage requirement, double is more expensive than float. It takes 8 bytes to store a variable while float just takes 4 bytes. This means if memory is a constraint then it's better to use float than double. By the way, the double type also has a larger range than float and if your numbers don't fit well in float then you have to use double in Java.
Labels:
core java
3 Examples to Generate Random Alphanumeric String in Java - UUID Example
Many times we need random alphanumeric String for one or another purpose and Thankfully Java provides a couple of ways to create random Strings which can be numeric, alphanumeric, or simply alphabetic. If you are familiar with Java API to generate random numbers like java.util.Random class and Math.random() method than It's quite easy to create an array with choice of characters like Alphanumeric, numeric, alphabets, special characters, and choose random characters to construct random String. If you like using an open-source library and happen to be using Apache commons-lang then generating an alphanumeric String is just one line of code as shown in the first example in our Java program.
Labels:
core java
,
Java Programming Tutorials
Saturday, July 22, 2023
How to fix "Error starting ApplicationContext" in Spring Boot? [Solution]
Hello guys, earlier, I shared how to solve creating bean error in Spring Boot and today, I am going to explain how to deal with error related to started Application Context. Spring Boot is a popular framework for building Java applications, providing a streamlined development experience. However, like any software, Spring Boot applications can encounter errors during startup. One common error that developers may encounter is the "Error starting ApplicationContext" error. This error typically indicates an issue with the application's configuration or dependencies. In this article, we will explore various solutions to fix this error and ensure a successful startup of your Spring Boot application.
Labels:
error and exception
,
spring
,
spring boot
Friday, July 21, 2023
Difference between Oracle SQL Query vs Microsoft SQL Server or Sybase? Answer
Oracle and Microsoft SQL Server are two of the most popular database but they are very different from each other and if you are migrating SQL queries or databases, tables from Oracle database to Microsoft SQL Server 2008 then you are bound to face some issues. The main reason for these porting issues are features that are supported and exists in the Oracle database, but not available in Microsoft SQL Server 2008 like SEQUENCE, Order by clause in subqueries, and derived tables, derived table without a name, etc. I am sure there are a few more and they will surface based upon different database objects you are using in your tables and queries.
Labels:
database
,
Microsoft SQL Server
,
Oracle
4 Best practices to name your JAR file in Java
If you are an author of an internal, proprietary Java library or an external open-source library, or you are one of those lucky developers who ship Java applications by yourself then you should follow these best practices while naming your JAR files. These best practices are a result of the practical experience of using hundreds of Java libraries and applications. Following these best practices will help in better management of JAR files. It's part of my other best practices articles like best practices while naming a variable, writing comments, overriding methods, multi-threading, JDBC, and best practices while dealing with passwords. If you are interested in learning more about best practices, you should read those articles.
Labels:
best practices
,
core java
Avoid Using "==" instead of equals() to compare Objects in Java? Example
In this part of Java programming mistakes, we will take a look at another common pattern, where programmers tend to use the "==" operator to compare Objects, similar to comparing primitives. Since the equality of objects can be very different in the physical and logical sense, and in the case of domain objects, it's mostly driven by business rules, comparing objects with the "==" operator, introduces subtle bugs, which are hard to find. The difference between equals() and == operator, one of the Java classics is also asked to find out if the developer is familiar with this important concept or not.
Labels:
best practices
,
coding
,
core java
,
programming
How foreach or Enhanced for loop works in Java? Example
It's a long time since JDK 1.5 introduced the enhanced for loop, almost 12 years ago in the year 2004, but still, many Java developers don't know the basics of enhanced for loop, also known as for each loop in Java. The enhanced loop provides the cleanest way to loop through an array or collection in Java, as you don't need to keep track of the counter or you don't need to call the hasNext() method to check whether there are more elements left. The key point, which many Java developer doesn't know about the enhanced for loop is that you can use any Object which implements the Iterable interface on for (: ) construct, you can even use enhanced for loop to loop through the array.
Labels:
core java
,
java 5 tutorial
Thursday, July 20, 2023
A Better way to write Complex SQL queries for Programmers
There is no doubt that writing code is more art than science, every coder cannot write beautiful code which is both readable and maintainable, even with experience. In general, coding improves with experience when you learn the art of coding e.g. favoring composition over inheritance or coding for interface than implementation, but only a few developers able to master these techniques. The same applies to SQL queries. The way you structure your query, the way you write it goes a long way to communicate your intent to the fellow developer. When I see SQL queries on emails from multiple developers, I can see the stark difference in their writing style.
Labels:
best of javarevisited
,
best practices
,
SQL
Monday, July 17, 2023
5 Tips for Running SQL Queries on Production Database
Did you ever face a situation where some of your innocuous-looking action has caused production issues and that too big time? Well, I hope you have not because it's certainly, not a pleasant experience. One such innocuous-looking action is running SQL queries on production databases. I had that in the past very early in my career where I removed some config as duplicates only to find after a week that it stopped publishing messages to one of the downstream. When you work in complex systems that have so many components, millions of lines of code, thousands of configurations, and many databases with hundreds of tables, you have to be really careful with anything you do.
Labels:
best of javarevisited
,
best practices
,
Microsoft SQL Server
,
SQL
Subscribe to:
Posts
(
Atom
)