Top 5 Courses to learn JavaFX in 2021 - Best of Lot

Hello guys, if you want to learn Java FX and look for the best Java FX courses, you have come to the right place. Earlier, I have shared the best Java Programming programming courses, and today, I will share with you the best online courses to learn Java FX from scratch. Java FX is the latest and greatest way for creating a GUI application in Java. There was a time when AWT and Swing was very popular for developing GUI based application in Java. Still, slowly Java Swing lost that place to C#, which became the standard language for developing desktop GUI and AWS lost the battle with Swing.

4 Reasons and Benefits of Using Multithreading in Java? Why Threads?

In one word, we use Threads to make Java applications faster by doing multiple things at the same time. In technical terms, Thread helps you to achieve parallelism in Java programs. Since CPU is very fast and nowadays it even contains multiple cores, just one thread is not able to take advantage of all the cores, which means your costly hardware will remain idle for most of the time. By using multiple threads, you can take full advantage of multiple cores by serving more clients and serving them faster. Since, in today's fast-paced world, response time matters a lot and that's why you have multi-core CPUs, but if your application doesn't make full use of all resources then there is no point adding them, multi-threading is one way to exploiting huge computing power of CPU in Java application.

How to use ConcurrentHashMap in Java - Example Tutorial and Working

ConcurrentHashMap in Java is introduced as an alternative of Hashtable in Java 1.5 as part of the Java concurrency package. Prior to Java 1.5 if you need a Map implementation, which can be safely used in a concurrent and multi-threaded Java program, then, you only have Hashtable or synchronized Map because HashMap is not thread-safe. With ConcurrentHashMap, now you have a better choice; because not only it can be safely used in the concurrent multi-threaded environment but also provides better performance over Hashtable and synchronizedMap.

Fixing Unsupported major.minor version 52.0 Error in Java

Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version e.g. JRE 1.7 or JRE 1.6. Simplest way to fix this error is install the latest Java release i.e. Java 8 and run your program. If upgrading to Java 8 is not an option then make sure you use Java compiler's cross compilation feature and compile source code for lower Java version by using -target option of javac command. If you have multiple JRE installed make sure that the latest one comes first in PATH environment variable.

ORA-00904: invalid identifier Error in Oracle 11g database - Solved

If you have worked in the Oracle database ever, you would definitely have seen ORA-00904: invalid identifier error. Doesn't matter which version you are working 10g, 11g or 12g, this is one of the most common error comes while doing CRUD (Create, Read, Update, and Delete) operations in Oracle. By the way, if you are a beginner, SELECT, INSERT, UPDATE and DELETE are used to perform CRUD operations in the Oracle database. What do you do if you get this error while running in SQL script? Like any error, you should first pay attention to error message, what is Oracle trying to say here. Invalid identifier means the column name entered is either missing or invalid, this is one of the most common causes of this error but not the only one.

How to Fix Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: in Java? Solution

If you are coming from C background than there is a pleasant surprise for you, Java programming language provides implicit bound checks on Array, which means an invalid array index access is not allowed in Java and it will result in java.lang.ArrayIndexOutOfBoundsException. An array is one of the most used data structures across all programming language and it’s no different in Java. In fact, Java API has used an array to build several useful data structures e.g. HashMap and ArrayList. These classes also throw IndexOutOfBoundsException if an invalid index is supplied to their get(int index) methods. One of the common mistakes Java programmer makes is invalid end condition on classical index-based for loops.

10 Difference between Java and JavaScript for Programmers

Programmers, developers, and internet users have always been confused between Java and JavaScript.  Many people still think that JavaScript is part of the Java platform, which is not true. In truth, JavaScript has nothing to do with Java, the only common thing between them is the word "Java", much like in Car and Carpet, or Grape and Grapefruit. JavaScript is a client-side scripting language for HTML, developed by Netscape, Inc, while Java is a programming language, developed by Sun Microsystems. James Gosling is the Inventor of Java, popularly known as the father of Java. 

How to create Custom Exception in Java - Tutorial Example

Sometimes we need to create custom Exceptions in Java, i.e. Exceptions which are not defined in JDK or any third-party library your application is using. Though it’s widely recommended on several Exception best practices articles, even Joshua Bloch has recommended in Effective Java to prefer standard exception over custom exception, sometimes you really need it. There are certain guidelines to help to find whether you really need a custom exception or not. 

How to Fix java.sql.SQLException: No suitable driver found for jdbc:jtds:sqlserver? Solution

java.sql.SQLException: No suitable driver found for 
There are two ways to connect Microsoft SQL Server from Java program, either by using Microsoft's official JDBC driver (sqljdbc4.jar) or by using jTDS driver (jtds.jar). This error comes when your supplied database URL didn't match with the JDBC driver present in the CLASSPATH. Many programmers who usually use jtds.jar, make a mistake while using sqljdbc4.jar by adding "microsoft" in JDBC URL. That makes URL invalid and JDBC API throws "java.sql.SQLException: No suitable driver: sqljdbc4.jar" error.

Checked vs Unchecked Exception in Java? Example

Checked and Unchecked Exception is two types of Exception exist in Java. Though there is no difference in functionality and you can very achieve the same thing with either checked Exception or Unchecked Exception, there is some difference on exception handling part. In this Java tutorial we will see what is checked and Unchecked Exception in Java, Examples of Checked and Unchecked Exception and most importantly we will learn when to use Checked Exception and when to use Unchecked Exception in Java and lastly we will see the difference between checked and unchecked exception to understand things better. 

Top 10 MQ Series Interview Questions Answers - WebSphere and Active MQ

MQ Series Interview Questions and Answers are collections of some of the questions asked on various MQ implementations e.g. IBM WebSphere MQ, Active MQ or Sonic MQ from different core Java and Enterprise Java (JEE) interviews. Most of these questions are from WebSphere MQ as it's the one that is most popular in large organizations, especially in the finance domain. By the way messaging is a key aspect of any enterprise application and you will always see some form of messaging between different systems in an organization. For example, In the finance world, most of the middle office to back office communication happens over messaging middle-ware like TIBCO or MQ Series. 

What is Covariant Method Overriding of Java? Example

Sometimes knowledge of a specific Java feature can improve code quality, Covariant method overriding is one such feature. Covariant method overriding was introduced in Java 5, but it seems it lost between other more powerful features of that release. Surprisingly not many Java programmer knows about Covariant overriding, including me, until I read, one of the best Java books on Collection framework, Java Generics, and Collection. Covariant method overriding helps to remove type casting on the client-side, by allowing you to return a subtype of actually return type of overridden method.

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver - cause and solution

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver Exception comes when you try to connect the Oracle database from Java program and Oracle driver is not available in Classpath. We have already seen How to connect Oracle database from Java program and found that, In order to connect to Oracle database, we load and register driver using Class.forName("oracle.jdbc.driver.OracleDriver") and this code loads a class at runtime using Reflection which throws ClassNotFoundException if the class in question e.g. "oracle.jdbc.driver.OracleDriver" is not found.

ReentrantLock Example in Java, Difference between synchronized vs ReentrantLock

ReentrantLock in Java is added on java.util.concurrent package in Java 1.5 along with other concurrent utilities like CountDownLatch, Executors, and CyclicBarrier. ReentrantLock is one of the most useful additions in Java concurrency package and several of concurrent collection classes from java.util.concurrent package is written using ReentrantLock, including ConcurrentHashMap, see How ConcurrentHashMap works in Java for more details. Two key feature of ReentrantLock, which provides more control on lock acquisition is trying to get a lock with the ability to interrupt, and a timeout on waiting for a lock, these are key for writing responsive and scalable systems in Java.

How to solve java.lang.UnsatisfiedLinkError: no ocijdbc11 in Java? Solution

"java.lang.unsatisfiedlinkerror no ocijdbc11 in java.library.path" error comes when you try to connect to Oracle 11g database using OCI (thick) driver by using tns name, but the ocijdbc11.dll file is not available in PATH or java.library.path environment variable. ocijdbc11.dll is a native library and if you know Java searches native library in PATH or a location specified by java.library.path system property, if it doesn't find the dll, then it throws java.lang.unsatisfiedlinkerror no ocijdbc11 in java.library.path error. This dll is usually found in C:\Programs\Oracle\ora11g\bin\ocijdbc11.dll, but it could vary depending upon your Oracle installation.

3 Examples to Concatenate String in Java

String concatenation is the process of joining two or more small String to create a big String. For example, you can create a full name by concatenating first and last name of a person. Java provides multiple ways to concatenate String, but the easiest of them is by using + operator. It is one of the magical operators in Java, though Java doesn't support operator overloading, it has made an exception in the case of String and + operators.  Plus operator is a binary operator and primarily used to add two numbers if both operands are integer but it can also used to concatenate String if either both or first operand is String. For example, "Java" + "Programming" will produce "JavaProgramming".

Dealing with org.hibernate.LazyInitializationException: could not initialize proxy - no Session in Hibernate Java

If you are working in the Hibernate framework, then you know that one of the key features of Hibernate is "lazy initialization", which allows the framework to lazily initialize dependencies, relationships, or associations lazily from the database on a need basis. For example, if you are dealing with a User object, which has a relationship with a Permission object like one user can have multiple permissions, then Hibernate may choose not to initialize the collection which holds all permissions at the time it initialized User object and instead returns a proxy object.

2 ways to solve Unsupported major.minor version 51.0 error in Java

Unsupported major.minor version 51.0 error comes when you run a class file created using Java 1.7 (major version 51.0) into a lower JRE version e.g. JRE 6, 5, or 4. There are two ways to solve this problem, first make sure you run your Java program in the same or higher version of JRE, on which it has compiled, and second use the cross-compilation option to create a class file compatible to a lower JRE. You can use javac -target option to create a class file for all JRE up-to-the JDK versions you are using for compilation.

Top 12 REST Web Services Framework Interview Questions Answers

REST web services have quickly become defacto web services in the web world and have almost replaced SOAP-based web services that rule the world before. with the growing use of REST in web technology space REST is also becoming increasingly important on J2EE and other web development interviews and if you say you know web-service then be prepare for some REST concept related questions. 

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 (  Hibernate has some poor logging in case of Exception, which has caused me hours to debug a simple problem.

How to fix org.hibernate.MappingException: Unknown entity Exception in Java? Solution

If you have used Hibernate with JPA and using annotation to declare your entity bean then you might have seen this confusing error called "org.hibernate.MappingException: Unknown entity". This error message is so misleading that you could easily lose anywhere between a few minutes to a few hours looking at the wrong places. I was using Spring 3 and Hibernate 3.6 when I got this error, which occurs when addEntity() method was executed. I checked everything, from Spring configuration file applicationContext.xml, Hibernate config file, my Entity class, and DAO class to see whether my Entity class is annotated or not, but I was still getting this error message.

Top 5 Courses to Learn Microservices and SOA (Service Oriented Architecture) in Java 2021 - Best Of Lot

Hello guys, Service-Oriented Architecture (SOA) and Microservice Architecture are essential skills for modern Java developers as most of the Java applications developed today follow SOA and Microservice architecture or their variants. Good knowledge of SOA architecture not only helps you to understand your current project better but also can give your career a boost, especially to senior Java developers who want to become software or solution architects. In the past, I have shared some books for aspiring software architects, and you can also use these courses along with those to master your architecture and solution design skills.

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.

Top 30 Scala and Functional Programming Interview Questions and Answers

Scala is a programming language which aims to provide best of both object-oriented programming and functional programming world. It not only allows you to  construct elegant class hierarchies for maximum code reuse and extensibility but also allows you to implement their behavior using higher-order functions and other functional programming technique. It is touted as one of the languages which can probably take over Java, though it didn't happen especially after Java 8 release which also provides some functional programming tools to Java e.g. lambda expression and stream

How to Fix java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet in Java Spring MVC? Solution

The java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet error comes when you deploy a Spring MVC application into Tomcat or Jetty and Servlet container not able to found this class, which usually found in the spring-webmvc.jar file. The DispatcherServlet is the core of Spring MVC framework, it implements the FrontController pattern and intercepts all HTTP requests sent to your Web application and subsequently routes it to the correct controller based upon URL mapping.