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. 

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 CyclicBarrierCountDownLatchBlockingQueueForkJoinPool, and recently CompletableFuture in this article, you will learn about Phaser, another useful concurrency utility for Java programmers. 

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.

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.

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.

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. 

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.

Wednesday, May 24, 2023

Review - Is Introduction To Programming the Internet of Things (IoT) Specialization on Coursera worth it?

The internet of things or IoT in a simple word is devices (things) embedded with sensors, software, hardware that are connected and exchange data with other devices such as smart refrigerators, smartwatches, intelligent cameras that can detect fires using artificial intelligence, self-driving cars that can take the wheel over the human, intelligent home security system and the list is endless. This kind of devices is programmed using the language like C and C++. Still, you can also use the python language, and people with IT backgrounds are more likely to learn and understand this kind of technology. Still, I’ve found one of the best courses that can teach you IoT and how to program yourself even if you are a non-technical person. An Introduction to Program the Internet of Things (IoT) Specialization course offered from the University of California Irvine.

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

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.

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.

SimpleDateFormat in Java is not Thread-Safe Use Carefully

SimpleDateFormat in Java is a very common class and often used to format Date to String and parse String into Date in Java, especially in pre Java 8 world, but it can cause very subtle and hard to debug issues if not used carefully because both DateFormat and SimpleDateFormat both are not thread-safe and buggy. A call to format() and parse() method mutate the state of DateFormat class and should be synchronized externally in order to avoid any issue but many Java developers are not aware of these. That's why it's better to completely avoid using SimpleDateFormat class especially if you are using Java Se 8 or higher version like Java SE 11 or Java SE 17. here are a few points which you should take care while using SimpleDateFormat in Java:

Java 8 Comparator comparing() and thenComparing() Example - Tutorial

Hello Java programmers, you may know that the JDK 8 has added a lot of new methods into the Comparator interface which makes comparing and sorting objects in Java really easy. Two such methods are called comparing() and thenComparing() which was added in the java.util.Comparator interface. These methods accept a key extractor function and return a Comparator that can compare to that key. The key must be Comparable though like String, Integer, or any Java class which implements java.lang.Comparable interface, I mean the key must implement Comparable interface. 

How to check if a File is hidden in Java? Example

This article is a quick tip to find hidden files in Java by checking the hidden properties of a File or directory from the Java Program. File Handling is a crucial topic in java already we have discussed how to create a file in java, how to create a directory, how to read write in a text file in Java, how to set permissions on the file, and some more aspects and we will discuss one more property of the file, i.e. hidden property. Now the question arises can we make a file Hidden using our java code or not.

How to create a hidden file in Java- Example Tutorial

In the last article, we saw how to check hidden files in Java and now we will see how to hide files in Java or make hidden files in Java. As we said File API in Java doesn’t provide any method to make a file hidden in Java but still you can apply some quick tricks to hide files from Java program. Like in a Unix environment any file whose names begin with a dot (.) is hidden so you can name your file starting with a dot (.)  and your File will be hidden in Linux or Unix Environment.

Tuesday, May 23, 2023

Top 5 Data Science Certifications to Aim in 2024 - Best of Lot

The demand for data scientists is at the all time high. It is regarded as the most enticing job in the IT business. Companies rely on Data Scientists to extract the most value from the data they collect. If you choose to pursue this professional path, these Data Science Certifications will assist you in demonstrating your value.The numerous Data Science Certifications prepare you to work as data experts in the market. They will assist you in developing the abilities needed in the sector to solve real-world situations. These credentials are used by recruiters to verify your abilities and expertise. Having some of these credentials can greatly assist you in your quest to become a Data Scientist. In this lesson, we'll look at the best certification programs, what they have to offer, and some other facts.

Top 5 Courses for DP-300 Administering Relational Databases on Microsoft Azure in 2024

Hello guys, if you are preparing for DP-300 or Exam DP-300: Administering Relational Databases on Microsoft Azure and looking for best resources like online courses and practice test then you have come to the right place. The Azure database administrator implements and oversees the operational parts of Azure Data Services and SQL Server-based cloud-native and hybrid data platform solutions. To accomplish day-to-day operations, the Azure database administrator use a range of methodologies and tools, including T-SQL skills for administrative administration.  This position is in charge of managing, securing, and optimising contemporary relational database solutions in terms of availability, security, and performance. To handle operational elements of data platform solutions, this position collaborates with the Azure data engineer function.  

How to implement Strategy Design Pattern in Java? (with Real World Example, Pros and Cons)

Strategy Design pattern is one of most useful versatile pattern, you will often see used in Object Oriented design. This pattern is one of the behavioral pattern mentioned by famous Gang of Four in there design pattern classics Elements of Reusable Design Pattern is Software development. As per definition goes, Strategy pattern allows you to encapsulate a set of algorithms and make them interchangeable. The best thing about Strategy pattern is that it allows you to pass a dynamic code to a method much like Lambda expression. In fact, it was one of the way to achieve same effect prior to Java 8. Also, there are multiple example of Strategy Pattern in JDK itself like Comparator and Comparable are the best example of Strategy Pattern in Java. 

Java 8 Predicate Functional Interface Example [Tutorial]

In Java 8, there is a defined functional interface which is called Predicate. The Predicate interface receives an argument and based on specific condition it returns Boolean value. It can be helpful in testing and it’s located in java.util.Function package. This is one of the many pre-defined or built-in functional interface which JDK provides. A couple of important ones are Supplier which can be used to produce a value of T (any object) and Consumer which can consume and project like takes data and print to console. forEach() is a good example of method accepting Consumer interface. Similarly many method accept a Predicate and when they do you can simply pass a lambda which generates a boolean by checking a condition. 

5 Ways to convert int to String in Java - Example Tutorial

If you have an int variable and wants to convert that into String object e.g. 1 to "1" or 10 to "10" then you have come to right place. In the past I have show explained Enum to Stringhow to convert String to float, String to double, String to int , and String to boolean and in this article, I will show you how to convert an int to String in Java. And, not one or two but I will show you 4 different ways to convert an int to String in Java, from easy to difficult and from common to unknown. Even though it's good to know multiple ways to solve a problem e.g. to perform this conversion, I will also suggest you what is the best way to convert int to String and why?

Difference between @Autowired and @Qualifier Annotation in Spring Framework? Example Tutorial

Hello Java programmers, the difference between @Autowired and @Qualifier annotations in Spring is a common question frequently asked in Spring on Java interviews, and if you are looking for an answer then you have come to the right place. Earlier, I have shared the best Spring courses and books, and in this article, Since most Java developers are familiar with annotations in Spring, they need to understand the difference between them and where to use them. Autowiring is a Spring Framework feature that enables you to inject the object dependency implicitly. This was added to Spring 2.5 to make an annotations-driven dependency injection that helps to "injects" objects into other objects or "dependencies." 

How to do Pagination in Oracle Database - SQL Query With Example

Many times we need an SQL query that returns data page by page i.e. 30 or 40 records at a time, which can be specified as the page size. In fact, Database pagination is a common requirement of Java web developers, especially dealing with the largest data sets.  In this article, we will see how to query Oracle 10g database for pagination or how to retrieve data using paging from Oracle. Many Java programmer also uses display tag for paging in JSP which supports both internal and external paging. In the case of internal paging, all data is loaded into memory in one shot and the display tag handles pagination based upon page size but it is only suitable for small data where you can afford those many objects in memory.

How to Remove Leading/Trailing White Space from a String in SQL Server? LTRIM, RTRIM Example

Unlike Java, Microsoft SQL Server 2008, 2012, 2014,  and even the latest version don't have a built-in trim() function, which can remove both leading and trailing space from the given String. But, SQL Server does have two built-in functions LTRIM() and RTRIM() to remove leading and trailing space. The LTRIM() function removes space from the left side of String so you can use it to get rid of leading space, while RTRIM() removes white-space from the right side of String so you can use it to delete trailing space. You can even combine these two methods to create your own TRIM() method in SQL SERVER e.g. LTRIM(RTRIM(column)) will act as a TRIM() method because it removes both leading and trailing space.

Top 30 Examples of MySQL Commands in Linux and UNIX

Hello guys, if you are working with MySQL database in Linux and looking for MySQL commands to perform common tasks like starting and stopping a MySQL server then you have come to the right place. I have been working with MySQL since last 15 years as Java developer and it was actually the first database I used in a real-world project. Since I need to work with the MySQL database daily, I compiled a list of MySQL commands which I keep handy. This saves me a lot of time while doing development and support and that's what I am going to share with you today. 

Difference between Truncate and Delete in SQL? Example

Truncate and delete in SQL are two commands which are used to remove or delete data from a table. Though quite basic in nature both SQL commands can create a lot of trouble until you are familiar with details before using it. The difference between Truncate and delete are not just important to understand perspective but also a very popular SQL interview topic which in my opinion a definite worthy topic. What makes them tricky is the amount of data. Since most Electronic trading system stores, large amounts of transactional data, and some even maintain historical data, a good understanding of delete and the truncate command is required to effectively work in that environment.

Monday, May 22, 2023

FutureLearn vs. edX vs. Udacity Review - Which one is better to learn Tech skills?

Online education grows year after year, and thousands of new online courses are added every month. The majority of people still in the 21st century think that the only way to learn new skills or get a deep understanding of a particular topic like IT is to attend a university and spend your valuable money & time learning something new that can get you a job.  The competition for online education is high, and there are a lot of platforms to choose from. Still, if you tend to learn more about the information technology industry, I recommend choosing one of the best platforms, which are futurelearn, edx, and udacity.

Difference between Clustered Index and Non Clustered Index in SQL - Example

In the SQL Server database, there are mainly two types of indexes, Clustered index, and the Non-Clustered index and difference between Clustered and Non-Clustered index are very important from an SQL performance perspective. It is also one of the most common SQL Interview questions, similar to the difference between truncate and delete,  primary key or unique key, or correlated vs non-correlated subquery. For those, who are not aware of the benefits of Index or why we use an index in the database, they help in making your SELECT query faster. 

Difference between Primary key vs Foreign key in table – SQL Tutorial Example

The main difference between the Primary key and the Foreign key in a table is that it’s the same column that behaves as the primary key in the parent table and as a foreign key in a child table. For example in the Customer and Order relationship, customer_id is the primary key in the Customer table but a foreign key in the Order table. By the way, what is a foreign key in a table and the difference between Primary and Foreign key are some of the popular SQL interview questions, much like truncate vs delete in SQL or difference between correlated and noncorrelated subqueryWe have been learning key SQL concepts along with these frequently asked SQL questions and in this SQL tutorial, we will discuss what is a foreign key in SQL and the purpose of the foreign key in any table. 

Database Website to Run and Practice SQL Query Online for FREE - SQLFiddle

Another day, I was looking for a website to execute SQL query online, since I have uninstalled Microsoft SQL Server because of memory and CPU constraint and I don't want to install it again, just for executing another query. Also, installing database is pain, it takes time and eats up lots of resources e.g. RAM memory, CPU, etc; Given so many databases to work with e.g. Oracle, MySQL, Sybase, PostgreSQL, and SQLLite, it's not really possible to have all of them in your poor laptop. Fortunately, my search leads me to this wonderful site called SQLFiddle, this is what exactly I wanted. This site offers support for a lot of popular databases, allows you to build your database schema online, and execute SQL query on the fly.

What is Referential Integrity in Database or SQL - MySQL Example Tutorial

Referential Integrity is a set of constraints applied to foreign keys which prevents entering a row in the child table (where you have the foreign key) for which you don't have any corresponding row in the parent table i.e. entering NULL or invalid foreign keys. Referential Integrity prevents your table from having incorrect or incomplete relationships e.g. If you have two tables Order and Customer where Customer is parent table with primary key customer_id and Order is child table with foreign key customer_id. Since as per business rules you can not have an Order without a Customer and this business rule can be implemented using referential integrity in SQL on a relational database.

Difference between SQL, T-SQL and PL/SQL?

Hello guys, if you are preparing for SQL and Database Interviews or any Software engineering interview and looking for difference between T-SQL, SQL, and PL/SQL then you have come to the right place. Earlier, I have shared 50 SQL Interview questions and 12 SQL query Examples from interviews and today, we are going to see another common and interesting SQL interview question, what is the difference between SQL, T-SQL, and PL/SQL? It is also one of the most common doubts among SQL beginners. It's common for programmers to think that why there are many types of SQL languages, why not just single SQL across DB? etc. Well, let's first understand the difference between SQL, T-SQL, and PL/SQL, and then we will understand the need for these dialects. 

Difference between IsNull and Coalesce in Microsoft SQL Server (with Examples)

Even though both ISNULL and COALESCE is used to provide default values for NULLs there are some key differences between them like ISNULL() is a T-SQL or Microsoft SQL Server-specific function or operator, and datatype and length of the result depends upon a parameter, but COALESCE is a SQL ANSI standard, it can accept more than one parameter and unlike ISNULL, the result doesn't directly depend upon a parameter, it is always the type and length of the value returned. Also, what is the difference between COALESCE and ISNULL is one of the frequently asked Microsoft SQL Server interview questions, and knowing these differences can help in both your day-to-day SQL development works and during job interviews.

Difference between close and deallocate cursor in SQL

Cursor in a database is used to retrieve data from the result set, mostly one row at a time. You can use Cursor to update records and perform an operation a row by row. Given its importance on SQL and Stored procedures, Cursor is also very popular in SQL interviews. One of the popular SQL questions on Cursor is close vs deallocate. Since both of them sounds to close the cursor, once the job is done, What is the real difference between close and deallocate of Cursor in SQL? Well, there is some subtle difference e.g. closing a cursor doesn't change its definition. In Sybase particular, you can reopen a closed cursor and when you reopen it, it creates a new cursor based upon the same SELECT query.

3 Ways to Remove Duplicates from a table in SQL - Query Example

There are a couple of ways to remove duplicate rows from a table in SQL e.g. you can use temp tables or a window function like row_number() to generate artificial ranking and remove the duplicates. By using a temp table, you can first copy all unique records into a temp table and then delete all data from the original table and then copy unique records again to the original table. This way, all duplicate rows will be removed, but with large tables, this solution will require additional space of the same magnitude as the original table. The second approach doesn't require extra space as it removes duplicate rows directly from the table. It uses a ranking function like row_number() to assign a row number to each row.

Top 25 DevOps Interview Questions and Answers for Experienced Developers

Hello guys, if you re preparing for DevOps Engineer interviews and looking for frequently asked DevOps Interview questions then you have come to the right place. Earlier, I have shared the DevOps RoadMapbest DevOps Courses, and DevOps books and in this article, I will share the frequently asked DevOps Interview Questions and their Answers. But, before we get to the most frequently asked DevOps interview questions, let me tell you what DevOps actually is. DevOps is basically a way of thinking or a collective approach to all the tasks that a company's application development and IT operation teams perform but it has taken the IT software development world by storm.

How to use useDispatch and useSelector? React Hooks Example Tutorial

Hello guys, if you are learning about React hooks and wondering how to use useDispatch and useSelector hooks in React application then you have come to the right place. Earlier,, I have shared the best React courseswebsites, and books and in this article, I am going to show you how React hooks make coding and statement management easier than it was before. The introduction of React hooks changed a lot in the react application development. Developers moved from complicated and length class-based components to simpler functional components that can do the same work in fewer lines of code. 

Sunday, May 21, 2023

Top 5 Websites to Learn Perl Programming and Scripting in 2024 - Best of Lot

Hello and welcome to this comprehensive and important article that has provided you with all the information you need concerning the best websites to learn Perl (Practical Extraction and Reporting Language). Perl is a programming language that was created by Larry Wall on February 1st 1988. This programming language is considered as an easy language to learn and therefore you should have no worries whatsoever. In this article, I have sampled not just websites and courses but the best ones which will lead you to the right destination as far as acquiring knowledge is concerned. No one wants poor services and am sure you also don’t need poor websites. If you seriously want to learn Perl, all the websites and courses I have listed below should be where you run to.

Top 5 Courses To Learn Salesforce Apex Programming Language in 2024 - Best of Lot

Before I get to the 5 best courses that will teach you all about the Salesforce Apex programming language, let me tell you a little more about this language. Apex is basically an object-oriented programming language that has been developed by Salesforce. The main aim of creating this language is to provide Software as a Service and Customer Relationship Management. Apex is a language that allows developers to create third-party Software as a Service application as well as add business logic to system events. Developers can do this by providing back-end database support as well as client-server interfaces.

Top 5 Courses for Six Sigma Green Belt Certification in 2024 - Best of Lot

The Green Belt is, without doubt, one of the most valuable courses that you can take in Six Sigma certification. But what exactly is the Green Belt? The question is a bit difficult to answer, simply because it means different things to different people. For example, it can help you open up new doors in your career as well as expand your understanding of the industry. It can also give you opportunities to be a part of unique projects as well as perform dynamic data analysis. If you are an absolute beginner in this space, I cannot recommend enough the Green Belt certification. It acts as the foundation for all the other belts. A Green Belt is the perfect place to begin.

Top 20 JSON Interview Questions with Answers for Beginners and Experienced Developers

Hello guys, if you are doing for a web developer interview or a Java web developer interview where you need to write server side application or backend code which uses HTTP to send and receive data then you should prepare about JSON. It's one of the most popular way to exchange data between two systems or between frontend and backend, client and server and most of the top programming language has API to create and parse JSON like Java has Jackson and JavaScript can by default support JSON because its nothing but JavaScript Object Notation.  JSON is also the default data format for REST API  and even GraphQL uses JSON to send request and receive response. 

Top 10 Free Online Tools to View and Validate JSON for Java and Web Developers

Hello guys, if you are working as Java or Web developer then you may know that JSON is one of the most popular format of exchanging data between client and server in modern web world. Almost all REST based Web services are now supporting JSON as preferred exchange format because of its competitive advantage over XML in terms of size, flexibility, and speed. With growing adoption of JSON as format to exchange data between systems, the number of tools and libraries have also increased. You will find several libraries to support JSON in various programming languages like  Jackson and Gson in Java and JSON Gems in Ruby

How to iterate over JSONObject in Java to print all key values? Example Tutorial

Hello guys, if you are wondering how to iterate over a JSONObject in Java and print all its fields and values then you have come to the right place. In this article, I will show you how you can print all data from JSONObject in Java. If you know, In json-simple library, one of the top 5 and lightweight JSON library, JSON object is a wrapper class which contains the actual JSON message. In the last article, I have explained how to parse JSON in Java using json-simple library and one question which pops up can we iterate over JSONObject properties? Well, yes, you can iterate over all JSON properties and also get the values from the JSONObject itself. In this article, I'll show you how you can print all keys and value from JSON message using JSONOjbect and Iterator.

Top 35 React.js Interview Questions Answers for Fullstack Java Developers

Hello guys, if you are preparing for React developer interviews and looking for frequently asked React.js interview questions then you have come to the right place. Earlier, I have shared the best courses, books, and websites to learn React.js and in this article, I am going to share 35 frequently asked React.js interview questions, suitable for 1 to 2 years experience developers. ReactJS is one of the most recently built open-source front-end programming languages. It came directly from Facebook's headquarter back in 2011. Earlier Recat.js was only limited to Facebook but now, it is one of the most extensively used programming languages all across the world.

What is state in React.js? useState Hook Example Tutorial

Hello guys, I have just started a new series, React for Java developers and I am going to publish React tutorials and examples to teach React.js, one of the most popular frontend libraries to Java developers. Since most full-stack Java development is happening on React and Spring Boot, it makes sense for Java developers to learn React.js. In the past, I have also shared both best React courses and books, as well as The React Developer RoadMap, which provides all the tools, libraries, and resources you need to become a proficient React Developer. 

Difference between var, let, and const in JavaScript? Example Tutorial

Hello guys, there are many ways to declare variables in JavaScript like var, let, and const and many JavaScript developer get confused when to use which keyword for declaring a variable in JavaScript. If you also have same doubt and want to understand the difference between var, let, and const in JavaScript then you have come to the right place. This is one of the popular JavaScript interview questions and frequently asked during telephonic and face-to-face round of web developer interview. Knowing the difference will not only make you answer this question better during interview but also to write better JavaScript code in your day-to-day work. Earlier, I have shared the best books and JavaScript courses for beginners and in this article, I will tell you the difference between varlet, and const and when to use them. They are three different ways to declare variables in JavaScript. 

How to use props in React.js? Functional and Class Component + Properties Example Tutorial

Hello guys, If you have ever worked with React.js, one of the popular JavaScript library for building UI components then you definitely know what components are. A React application is made of several components and that is why components in React are defined as the building blocks of the application. In simple terms, a component is a class or function that can accept input and return a piece of code that defines a UI. Every React component can have input. These inputs are known as props. Props stand for properties and they are optional. A component works fine without props but they are one of the most useful parts of React.

React.js useState, useEffect and useDispatch Hooks Example - Tutorial

Hello guys, if you want to learn about Hooks in React.js like useState, useSelector, useEffect, and useDispatch then you have come to the right place. In the past, I have shared the best React courseswebsites, and books and in this article, I am going to show you what is React hooks and how they make coding and statement management easier in React.js. If you remember, React.js is created by Facebook and ever since it came out in 2013 and since then, it has become one of the biggest players in the front-end development community. Today, React.js demand for frontend development is more than any other framework or library. There are several reasons for its popularity. React is flexible, easy to learn, programmer-friendly, and most importantly, it's high performing. 

Saturday, May 20, 2023

Top 5 Websites to Learn C and C++ Online in 2024 - Best of Lot

Hello guys, if you want to learn C and C++ online and looking for best online resources like online courses, books, and tutorials then you've come to the right place. Earlier, I have shared both free C++ courses and paid C++ courses as well as books and in this article, I Am going to share best places to learn C++. With its expansion of the C programming language, C++ has become the most capable object-oriented programming language available today. C++ is the engine that drives the world; it is used practically everywhere for low-level tasks. Even with seemingly simple programming languages, learning to program may be a tough task for many people. C++ is one of the most often used coding languages, and there are several programming websites that may assist you in learning C++ thoroughly.

Top 5 Websites to learn Mobile App development in 2024 - Best of Lot

Hello guys, if you want to become an App Developer in 20243 or just want to learn Mobile app development using iOS and Android and looking for best online resources to learn App development like online courses, books, tutorials, and websites then you have come to the right place. Earlier, I have shared best free App development courses and best iOS and Android courses and in this article,  I am going to share 5 best places where you can learn App development online. Everything is accessible online in the digital era, including meals, flights, and restaurants. When it comes to mobile app creation, numerous online companies provide a variety of courses to get you started with app development.  Furthermore, these online services do not just provide mobile app development courses; they also offer a variety of other online courses. 

Friday, May 19, 2023

Top 7 FutureLearn Courses to Take in 2024 - Best of Lot

Earning a degree nowadays from a university in things like programming, science, artificial intelligence isn’t enough to be ready for the market and have a job because much of what you learn in the university cant’ be applied in the real-life. Hence, you need to enhance your expertise from people who gain experience in that domain in real life, and you can do that by enrolling in an online course.
Many online platforms offer courses created by normal people like udemy, but some other platforms accept only courses created by big universities such as Coursera, edx, and futurelearn. Futurelearn is a digital platform located in the UK founded in December 2012, offering courses for free, and some of them are paid. The courses are created by top universities such as the university college London and the University of Oslo.

Top 6 Websites to Learn PHP for FREE in 2024 - Best of Lot

Hello guys, if you want to learn PHP and looking for online resources like online courses, books, and tutorials then you have come to the right place. In the past, I have shared best PHP courses and best free PHP courses and in this article, I Am going to share best websites to learn PHP in depth. Welcome dear learner and hope you will be impressed with the best websites to learn PHP that are listed here. PHP is a programming language that is generally a scripting language used in web development. It was first created in 1994 by a programmer called Rasmus Lerdorf. PHP originally stood for Personal Home Page, but currently stands for Hypertext Preprocessor. It is an easy language to learn so you should not hesitate to start learning. There are always various courses which vary from price to price so you just have to pick what suits you from the list of suitable courses listed.

How to return JSON, XML or Thymeleaf Views from Spring MVC Controller? Example Tutorial

Hello guys, if you are working in Spring based web application and you wan to return JSON, XML, or Thymeleaf View from your application but don't know how to do that then you have come to the right place. Earlier, I have shared how to create REST API in Spring, React + Spring project, and Spring Boot Interview Questions  and In this tutorial we are going to discuss, how to return to JSON, XML, or Thymeleaf view from the Spring MVC controller. To ensure that your payload from the MVC endpoint, ensure your project is using the Spring Boot starter web. You can use the following dependency to include spring boot starter web in your project. 

Top 5 Spring MVC Annotations for RESTful Web Services in Java

Hello guys, Spring framework is one of the most popular Java framework and Spring MVC is probably the most common way to develop web applications in Java, but things just doesn't end there. In the past a couple of years, Spring has become the best way to develop RESTful Web services in Java. Despite numerous RESTful Web Service frameworks in Java world e.g. Restlet, Jersey, RESTEasy, and Apache CFX, Spring MVC has maintained its position as the leading framework for creating RESTful APIs in Java, and there are multiple reason why Spring is the best framework for Java developers for creating RESTful solutions and we will look one of them in this article. 

How to test a Spring Boot Application using JUnit, Mockito, and @SpringBootTest? Example Tutorial

Hello guys, if you are wondering how to test your Spring Boot application then you are at the right place. In the past, I have shared several Spring and Spring Boot resources like best Spring boot coursesbest Spring Boot booksSpring Boot Interview questions and even Spring Boot projects and in this article, I am going to share how to test your Spring Boot application using @SpringBoot annotation. This article will teach you essential concept for testing Spring Boot applications. It's expected that you are know about essentially the fundamentals of Java, Maven and Spring Boot (Controllers, Dependencies, Database Repository, and so on).

What is @SpringBootTest Annotation in Java and Spring? How to use it? Example Tutorial

Hello guys, if you want to learn what is @SpringBootTest annotation and how to use this annotation to test your Spring Boot application then you have come to the right place. The @SpringBootTest annotation is a powerful annotation in Spring framework which is used to load entire application context for Spring Boot application and create integration test. It allows you to test your application in the same way as it runs on production. You can use this annotation to test your controller, service, repository classes and every other part of your Java Spring Boot application. Earlier, I have shared the best Spring Boot courses and Spring Boot Testing interview questions and in this article, I am going to explain to you about @SpringBootTest annotation. Before diving into how to use @SpringBootTest annotation. It is good to briefly introduce Testing in Spring boot. 

Spring Data JPA @Query Example - Tutorial

Hello guys, if you are learning Spring Data JPA framework or using Spring Data JPA in your project and are not sure how to use @Query annotation then you have come to the right place. Earlier, I have shared the best Spring Data JPA courses and Spring Data JPA Interview questions and in this article, I am going to show you how to use @Query annotation from Spring Data JPA to create dynamic SQL queries. Spring is a popular Java application framework for creating enterprise applications and Spring Boot is an evolution of the Spring framework which helps to create standalone applications in a minimal effort. In this tutorial, we are going to discuss how to create queries using Spring Data JPA with an example. So let’s have a look with a Spring data JPA @Query example.

How to validate HTTP POST Request Payload on Spring MVC controller? Example Tutorial

Hello guys, if you are wondering how to validate incoming request payload in Spring MVC based Java web application then you have come to the right place. You can use JSR-303 Bean Validation Framework and @Valid annotation in Spring MVC to check the request data on POST request.  Earlier, I have sharebest Spring MVC courses for Java developers and In this tutorial, we are going to discuss how to validate incoming payloads on the Spring MVC controller which is also can be defined as validating the request body in the RESTful web services. So first let's have a look at validating the request body in the RESTful web services. Think you have a JSON post request and you are going to consume it. There should be a validation to this post request as the requested input will be zero or in a not accepted format.

Thursday, May 18, 2023

How to fix "java.lang.SecurityException: Missing required Permissions manifest attribute in main jar" [Solved]

If you are working Java Web start application using JNLP and suddenly started throwing "java.lang.SecurityException: Missing required Permissions manifest attribute in the main jar", then check whether you have updated the Java or JRE on your machine. From JDK 1.7 update 51, Java has tightened the security further with a number of changes like

1) Block all self-signed and unsigned Java applications and Applets if you have opted for HIGH security in Java Control Panel, which is also the default one.

2) Require a "Permission" attribute for a High-security setting

3) Warning users of missing permission attributes for the medium security settings.

How to deal with Java.rmi.MarshalException: CORBA MARSHAL in Java? Solution

Java has some mysterious RMI exceptions one of them is java.rmi.MarshalException: CORBA MARSHAL, which was bothering me for the last couple of days while working. I thought to put this solution post similar to my earlier post How to solve OutofMEmoryError in Java and Fixing ClassNotFoundException in Java. RMI is still used in many places and many times it creates too many problems and chew-up your a lot of time to find the exact cause and solution.

How to fix java.io.IOException: Map failed and java.lang.OutOfMemoryError: Map failed? Example

While working with memory mapped file, you may get java.io.IOException: Map failed error, which is mainly caused by Caused by: java.lang.OutOfMemoryError: Map failed error as shown below. This error usually comes while mapping a big file in memory e.g. trying to map a file greater than 1 or 2GB

java.io.IOException: Map failed
 at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:888)
Caused by: java.lang.OutOfMemoryError: Map failed
 at sun.nio.ch.FileChannelImpl.map0(Native Method)
 at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:885)
 ... 6 more

How to fix "No Property Found for Type class " Exception in Spring Data JPA [Solved]

Hello guys, if you are struggling with "No property save found for type class" In while working with Spring Data JPA then you have come to the right place. Earlier, I have shared the best Spring Data JPA courses and in this tutorial, we are going to discuss how to fix Spring Data JPA - "No property found for type" exception. This is a common type of error that we can find on Spring applications because of many reasons. We are going to discuss some of the occasions where this error happens and it may help to solve the error. So we will go with examples of what kind of problems that the developer's might get related to the "No property found for type" exception in Spring Data JPA.

[Solved] How to fix VirtualBox - /sbin/mount.vboxsf: mounting failed with the error: Protocol error

Virtual box is a great tool for Java developer to run Docker and Linux on Windows Machine, especiall for them who need to develop and debug Java program in Linux environment. I use Oracle's virtual machine, VirtualBox to run the Linux operating system from my Windows machine. It's the most simple way to have two operating systems on your laptop or PC. Since I run most of the Java programs in Linux, VirtualBox gives me a nice interface to run UNIX commands right from the Windows box. This blog post is about the mounting of a shared folder failed error in Oracle's Virtualbox VM. It was working fine the day before yesterday and now, after I restarted my virtual box and tried to mount my shared folder, I was greeted by this error: "/sbin/mount.vboxsf: mounting failed with the error: Protocol error"

How to fix Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory in Java

This error means your code or any external library you are using in your application is using the SLF4J library, an open source logging library, but it is not able to find the required JAR file e.g. slf4j-api-1.7.2.jar hence it's throwing Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory. If you look at the error, you will see that it's saying it is not able to find the class org/slf4j/LoggerFactory or org.slf4j.LoggerFactory. The package name indicates that it's part of SLF4j, hence you need SLF4j JAR files e.g. slf4j-api-1.7.2.jar in your application's classpath. So, go ahead and download the JAR file from SLFj website or from Maven Central repository and restart your application.

How to fix invalid target release: 1.7, 1.8, 1.9, or 1.10 Error in Maven Build? Solution

If you are building your Java project using Maven, maybe in Eclipse or from the command prompt by running mvn install and your build is failing with an error like "invalid target release: 1.7" or "invalid target release: 1.8" then you have come to the right place. In this article, I'll show you the reason why this error occurs and how you can deal with these errors even with higher Java versions like Java 9, 10 installed on your machine, or maybe with Java 11 in the coming month. The root cause of the problem is that you have specified a higher Java version in your pom.xml file for the Maven compiler plugin than what Maven knows in your system, and that's why it's saying invalid target release.

How to Fix NullPointerException due to Space in HQL named queries in Hibernate? Example

If you are using Hibernate for implementing the persistence layer in Java and JEE application from a couple of years then you would have seen this notorious NullPointerException while executing HQL named queries, Exception in thread “main” java.lang.NullPointerException at org.hibernate.hql.ast.ParameterTranslationsImpl .getNamedParameterExpectedType (ParameterTranslationsImpl.java:63).  Hibernate has some poor logging in case of Exception, which has caused me hours to debug a simple problem. By looking at NullPointerException below (look full stack trace below), I had no clue that it's coming because of a missing space on the HQL (Hibernate Query language) query. 

How to Fix java.lang.UnsatisfiedLinkError: lwjgl64.dll : Access Denied Error? Minecraft Solution

You can resolve java.lang.UnsatisfiedLinkError: lwjgl64.dll : Access Denied error in Minecraft by disabling your anti-virus and run. Later you can whitelist the lwjgl64.dll so that your anti-virus will not block it again. I have talked about java.lang.UnsatisfiedLinkError a couple of times on this blog e.g. here and here. But, today I am going to show you one more real-life example of java.lang.UnsatisfiedLinkError, which is more interesting. We'll also learn and how to deal with that. This problem is related to Minecraft, one of the most popular games written in Java. Precisely, we are going to solve the "Exception in thread "main" java.lang.UnsatisfiedLinkError: lwjgl64.dll: Access denied" error.

How to Fix java.net.SocketException: Failed to read from SocketChannel: Connection reset by peer? Example

You might have seen the java.net.SocketException: Failed to read from SocketChannel: Connection reset by peer error while working with Java NIO based server which is using SocketChannel instead of InputStream for reading data from the network. In general, this can come at both client and server end of a client-server Java application which is using TCP/IP to connect each other. Though this exception usually comes at the server end and the client was complaining that they are not able to connect.  From the error message, it's quite clear that before the client or server could read the data from SocketChannel, another party has disconnected the session. Let's see the root cause of the problem and how to solve java.net.SocketException: Failed to read from SocketChannel: Connection reset by a peer in Java application.

How to fix java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer? [Solution]

The error message clearly says that the Java runtime is not able to find a class called ServletContainer for the Jersey library. This is the Servlet class you have specified in the deployment descriptor of your application. It's similar to DispatcherServlet of Spring MVC and this error is similar to the error you get when DisplayServlet was not in the classpath.
Anyway, java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer comes when you are trying to use Jersey but have not added required dependency on your classpath e.g. those JAR files which contain the class "com.sun.jersey.spi.container.servlet.ServletContainer".

Wednesday, May 17, 2023

Data Visualization with Tableau Specialization Review - Is it worth it?

In this modern age with large data and technology, data visualization is becoming a more important in-demand job among companies since they need to analyze that data and visualize them to get more information about their customers, revenue, and more. Data visualization is the process of converting a large amount of data into charts to have a more clear view of what’s going inside your company, as they say, a picture worth a thousand words. Learning these skills is a must in many job fields if you are going to be a data analyst, data scientist, machine learning engineer, and many other fields, just to name a few. There are many software and programming languages such as python and R to make data visualization.

Top 5 JavaScript Certifications to Aim in 2024 - Best of Lot

The online programming language JavaScript is quite popular. It may be used for a variety of things, including generating cookies and recognizing browsers, as well as enhancing the appearance of a website and verifying forms.Understanding JavaScript and associated technologies like the DOM and HTML helps you to create and manage interactive dynamic websites. Chrome, Edge, Firefox, Internet Explorer, and Safari are just a few of the prominent web browsers that support JavaScript.
JavaScript is not only one of the most widely used programming languages and web technologies, but it is also a highly sought-after IT expertise. As a result, selecting JavaScript is a wise decision.

10 Tips to Debug Java Program in Eclipse - Examples

How to debug a java program in Eclipse

Debugging is a must-have skill for any java developer. Having the ability to debug java program enables to find you any subtle bug which is not visible during code review or comes when a particular condition offer, This becomes even more important if you are working in high-frequency trading or electronic trading system project where time to fix a bug is very less and bug usually comes on the production environment and doesn't appear in your Windows XP machine. in my experience debugging the java applications also helps you understand the flow of the java programs.

What is java.library.path? How to set in Eclipse IDE? Example

java.library.path is a System property, which is used by Java programming language, mostly JVM, to search native libraries, required by a project. Similar to PATH and Classpath environment variable, java.library.path also includes a list of directory. When Java code loads a native library (a library or executable written in a language like C, C++, or native code) using System.loadLibrary("name of library") method, java.library.path is scanned for specified library. If JVM doesn't found the requested native library, then it throws java.lang.UnsatisfiedLinkError: no native library in java.library.path.

How to increase heap size of Eclipse - Solving OutOfMemoryError? Example

If you are running lots of Java projects in Eclipse and it's throwing OutOfMemoryError every now and then it's time to increase the heap memory of Eclipse. Since Eclipse is a Java program, you can increase the heap size of Eclipse by using JVM memory options -Xms and -Xmx. There are two ways to provide JVM options to eclipse either updating the Eclipse shortcut or adding -vmargs on eclipse.ini file. I prefer the second option because it's clean. I'll tell you the exact steps to increase the java heap space in Eclipse but before that some background on why I had to increase the heap memory of Eclipse.

Why use Spaces over Tabs for Indentation in Code Editors - Eclipse

When I started coding in Eclipse, I was not aware that by default Eclipse uses tabs for indentation and tabs can have varied with e.g. 1 tab can be equal to 2 spaces or 4 spaces or even 8 spaces. Sometimes, It's all up to you how you configure tabs in your code editor, and other times just at the mercy of the tool you don't know how to configure like VIM in UNIX. I only realize the problem when I found too many differences in a file while check-in in into SVN. Apparently, other people were using different indentations (spaces) and that's why the file was showing so many differences when I reformatted them in Eclipse. 

Eclipse - How to add/remove external JAR into Java Project's Classpath? Example

There are multiple ways you can add an external JAR into the classpath of a Java project in Eclipse, but all goes via adding them into the build path. Many beginners struggle to add JARs into classpath and we will try to address that problem in this tutorial. You will learn step by step tutorial to add an internal or third-party JAR in your application's CLASSPATH in Eclipse Indigo. Since this feature has hardly changed in any Eclipse version, you can follow some steps in Eclipse Kepler, Indigo, and Juno versions to add JARs into the classpath.

How to fix Failed to load Main-Class manifest attribute from jar in Java? Eclipse Netbeans Tutorial Example

If you have tried creating JAR file and running Java program from command the line you may have encountered "Failed to load Main-Class manifest attribute from jar", This error which haunts many Java programmer when they enter into command line arena and tries to create JAR file in the command line or IDE like Netbeans and Eclipse. The major problem with "Failed to load Main-Class manifest attribute from jar" error is that, it’s unnecessary creates panic which it doesn't deserve, maybe because the process involves of creating and running JAR is not that common like running Java program using the "java" command.

How to decompile class file in Java and Eclipse - Javap command example

The ability to decompile a Java class file is quite helpful for any Java developer who wants to look into the source of any open source or propriety library used in a project. Though I always prefer to attach sources in Eclipse of most common libraries like JDK it’s not always possible with an increasing number of dependencies. Java decompiler (a program that can decompile Java class files to produce source files) is very helpful in such a situation. By using Java decompiler you can easily check out the source of any .class file. Thanks to Eclipse IDE and the increasing number of free plugins available for Java developers, You can have powerful Java decompile in your armory.

How use Spaces instead of Tabs in Eclipse Java editor? Example

I use Eclipse IDE extensively to write Java programs for testing and example purposes, but when I copy those programs in any text editors e.g. VIM, Notepad, TextPad, or Edit plus, the indentation goes weird. I see a lot of white spaces which makes the program wider than expected. This happens because when you copy Java program from Eclipse to a text editor, tabs are converted to spaces and different editor has the different settings of tabs. UNIX text editors prefer tab is 8 spaces, Windows text editors, and IDEs e.g. Eclipse treats tabs as 4 spaces.

How to Map a Network Drive to Windows Machine - net use Command Example

Mapping network drive in Windows 10 or other versions of Windows operating system e.g. Windows 7  or Windows 8 is much easier and faster by using the command line than by doing it on Windows Explorer. If you have been working in a Windows environment with a bunch of Windows Server 2016 or 2012  servers and your job requires frequent access, copy or paste from the local machine to those remote machines then mapping them as a network drive is the best option. 

How to Increase Console Buffer Size in Eclipse IDE - Output and Debug Console Example

By default Eclipse, IDE has a limit on console output, also known as console buffer size. This means, your Eclipse console will overfill quickly if you are running a Java server program, which usually does a lot of logging. Once this happens, you start loosing logs. whenever new logs appear, an equal number of oldest logs are truncated. Thankfully there is a way to increase output capacity in Eclipse IDE. I discovered this tip, on my search of Eclipse productivity tips e.g. Eclipse shortcuts and settings to organize import. You can increase the console buffer size, which is specified in characters by using Eclipse preferences. Eclipse Indigo has a default console buffer size of 250000 characters.

Tuesday, May 16, 2023

Top 5 Big Data Certifications to Aim in 2024 - Best of Lot

For IT experts, this is an incredibly exciting period. Expert technicians can expand their knowledge and improve their competence thanks to an endless stream of advancements, allowing them to specialize in a wide range of professions or move into a new field. This is especially true in the case of big data, where the number of relevant job opportunities appears to be growing at the same astonishing rate as the data itself! All of this data will need to be housed in scalable, cost-effective data systems that can be accessed, analyzed, and turned into useful information. That is why big data specialists are in great demand now and will continue to be in the future.

Top 5 Websites to Learn Ruby in 2024 - Best of Lot

Ruby is a programming language that is in most cases used for building or creating web applications. It was developed in the 1990s in Japan. By now, I hope you already know or understand the definition of Ruby. What you must be currently looking for is the skills in Ruby. You have visited this site and therefore you will get to know the best websites to learn Ruby. There are quite a number of them but I have narrowed down to only the best ones that will not give you problems while trying to master Ruby skills. All you need is to select a course and you are good to go. Down here, are the best places you should visit so take a look and you will be impressed.

Difference between Web3, Metaverse, and Blockchain?

Web3, metaverse and blockchain are probably the most highlighted terms in every discussion about modern technology. Most recently, the web3 vs. metaverse vs. blockchain debate has been gaining momentum. Web3 and metaverse have shown massive potential for transforming user experiences on the internet.  The superficial perspective on web3 and metaverse shows that both of them have many overlapping aspects. However, web3 and metaverse are completely different topics, and blockchain is the technological foundation for creating web3 and metaverse solutions. The following post helps you understand the difference between web3, blockchain and metaverse.