Difference between Error and Exception in Java

Here in this article you will learn about difference between error and exception in java. In exception hierarchy we need to see where these two classes exist. Throwable Class is the root for the Java Exception Hierarchy. Throwable contains two chain of classes, Exception and Error. Exceptions Errors Mostly because of our programs. These occur because of lack of system resources. Exceptions are recoverable. Errors are not recoverable. Exceptions can be handled using try catch blocks. Errors cannot be handled

Read more

Solve Missing Return Statement Error in Java

There are many types of errors that can be encountered while writing a Java Program. The errors can be with the Syntax or the Semantics of the Java program. The Java Community tries hard to avoid these errors at compile time itself, so that a programmer does not have to run the program to encounter the error. Use of generics is one way by which Java provides Type Safety by throwing errors at compile time itself. Solve Missing Return Statement

Read more

Error could not find or load main class in Eclipse – 3 Ways to Fix

In this tutorial you will learn about the error could not find or load main class in eclipse and the ways that could solve this error. When class loader is unable to load the main class of our application then this error will come. Many reasons are there for this has to be happen. In case you are struggling to solve your program errors or need java assignment help then you can visit www.geeksprogramming.com. Ways to Fix Error could not

Read more

Solve Cannot make a static reference to the non-static method Error

Here you will learn to solve error “cannot make a static reference to the non-static method” or “non static method cannot be referenced from a static context”. Lets take one example where this error occurs. When you will compile below code then you will get an error.

Why this Error Occurs? This error occurs when we try to access a non static method or member directly inside a static method. In above code print() is a non static method

Read more

Solve java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Error

In this tutorial you will learn to solve java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver error. If you are using jdk 1.8 and trying to connect java with MS Access database then you will get error java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver. This is because java 8 or jdk 1.8 does not support jdbc odbc bridge. To connect with ms access you have to import some libraries. How to Solve java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Error? 1. Download jars from below link and import in the ide you are using. Link: http://www.mediafire.com/download/ahzw21rrp20qiw8/ucanaccess.rar   Also Read: How

Read more

Solve javac is not recognized as an internal or external command Error

The error javac is not recognized as an internal or external command arises when we try to compile any java source file using javac command. The reason for this error is because the path of javac command is not set properly. This error can be solved easily by setting javac compiler path in environment variables. How to solve javac is not recognized as an internal or external command Error? This can be done in two ways as given below.  

Read more
1 2