How to Create and Run First Kotlin Project in Eclipse IDE

According to the Stack Overflow Developer Survey Results, 2019 Kotlin is the 4th most loved programming language and among the top programming languages with the highest salaries worldwide due to its efficiency, 100% interoperability with java, reduced crashes and low cost of adoption.

In this tutorial, we’ll be going through the steps to create and run your first Kotlin project in Eclipse IDE.

Installing Eclipse IDE

  1. For the Kotlin development, you will need "Eclipse IDE for Java developers". If you already have Eclipse IDE for Java developers, you can skip this step. It has everything you need for Kotlin including important extra features like a Git client, XML Editor and Gradle integration for android development. 

  2. The easiest way to get Eclipse IDE for Java developers is through the Eclipse installer. Eclipse installer is the most efficient way to install Eclipse. It is a proper installer (no zip files) with easy to follow steps. You can download the Eclipse installer from here. Keep in mind that you’ll need a Java runtime environment (JRE) to run Eclipse IDE for Java developers which can be downloaded from here.
    Download eclipse ide for java developers

7 Difference Between float and double Datatypes in Java

double and float are datatypes in java. Although both represent floating-point literals still there exist some minor differences between them. In this post, I will be sharing the difference between float vs double in java, when to prefer float over double or double over the float, similarities between them and java code examples.

Read Also : Best way to Calculate Maximum and Minimum value of Datatypes

What are literals?
Any constant value which is assigned to a variable is called a literal. In other words, literals are constants.
Java has five types of literals i.e., integer literals, boolean literals, Character literals, String literals, and floating-point literals.
float and double are called floating-point literals.

Difference between float and double in Java

1. Memory : float takes 4 bytes (32 bits) where as double takes 8 bytes(64 bits).
Below is the java program to print size a float and a double takes.

5 Best Paid Spring Boot Online Courses for Beginners in 2019 : Worth Every Penny

Congrats! for thinking about learning Spring Boot. Spring Boot is a java framework that makes production-ready web applications ridiculously easy. This framework is made on top of the existing Spring Framework. The great thing about the Spring Boot application is just like your core java application, it runs by using the classic main method. In this tutorial, I will be sharing the best paid online Spring Boot courses for beginners.

Read Also : Best Online Courses for Java Beginners

One of the advantages of Spring Boot is, it does not require to set up a web server. There is an embedded Tomcat server in Spring Boot. Another advantage is you can focus on the application/service logic instead of wasting time on configurations and dependency management.

Before sharing online courses for Spring Boot, I want to tell you about the book which is great to enhance your knowledge. The book is Spring Boot in Action. This book is useful if you have basic knowledge of Spring Boot. I will recommend starting with an online course then move on to the book.

Best Paid Spring Boot Online Courses for Beginners

1. Spring Boot For Beginners

6 Difference between Error and Exception in Java with Examples

Difference between Error and Exception in java is one of the most common interview questions for java beginners. Errors are the conditions that can not be handled and irrecoverable. Every time when Error occurs, the program terminates abruptly. Errors belong to the Unchecked category. It occurs at runtime only. On the other hand, Exceptions are the conditions that can be handled using try/catch, throw keywords. Exceptions can occur at compile-time or runtime. It is divided into two categories Unchecked Exception and Checked Exception. In this tutorial, I will be sharing Error vs Exception, an example of Error, an example of Exception and similarities between them.

Read Also : throw vs throws in java

Difference between Error and Exception in Java

1.Time of occurrence : Exceptions can occur at compile time or runtime, depending on the type of exception occurred. For example, NullPointerException is a runtime exception on the other hand IOException is a compile-time exception.

Errors occur only at runtime. They are not known to the compiler.

Read Also : Programs on Exception Handling in Java

2. Recovery : Programs can recover from Exceptions by handling them appropriately using a try-catch block or throw keyword in java.

Programs can not recover from Errors once they occur. Errors will definitely cause termination of the program.

Perfect Number Program in Java with Examples

In this tutorial, I will be sharing what is Perfect number, examples of Perfect number, algorithm, and java program to check whether a given number is Perfect number or not.

Read Also : Java Program to Check Duck Number

What is Perfect Number

Perfect number is a positive integer(number more than zero) that is equal to the sum of its proper positive divisors(or factors) excluding the number itself.
Examples :

Number to check : 28 
28 is divisible by 1,2,4,7,14 (Remember to exclude number itself i.e 28)
1 + 2 + 4 + 7 + 14 = 28 (sum of positive divisors is equal to given number 28)

                        // 28 is a Perfect number
 
Number to check : 6
6 is divisible by 1,2,3 (Remember to exclude number itself i.e 6)
1 + 2 + 3 = 6           (sum of positive divisors is equal to given number 6)
                        // 6 is a Perfect number
Number to check : 496 
496 is divisible by 1,2,4,8,16,31,62,124,248 (Remember to exclude number itself i.e 496)
1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248 = 496 (sum of positive divisors is equal to given number 496)
                        // 496 is a Perfect number
 

Below are examples of numbers which are NOT Perfect numbers