Category: Core Java

Write a singleton class. 0

Write a singleton class.

Description: Singleton class means you can create only one object for the given class. You can create a singleton class by making its constructor as private so that you can restrict the creation of...

Find out middle index where the sum of both ends is equal. 0

Find out middle index where the sum of both ends is equal.

Description: You are given an array of numbers. Find out the array index or position where the sum of numbers proceeding the index equals to the sum of numbers succeeding the index.

Output Starting from...

Find out duplicate number between 1 to N numbers. 0

Find out duplicate number between 1 to N numbers.

Description: You have got a range of numbers between 1 to N, where one of the number is repeated. You need to write a program to find out the duplicate number.

Output: Duplicate...

How to reverse Singly Linked List? 0

How to reverse Singly Linked List?

Description: Write a sample code to reverse Singly Linked List by iterating through it only once. Recursive Method: 1) Divide the list in two parts – first node and rest of the linked list....

Common Elements Between Three Arrays 0

Common Elements Between Three Arrays

Program: Write a program to find common elements between three arrays. Description: Write a program to identify common elements or numbers between three given arrays. You should not use any inbuilt methods are the...

0

Even Odd Number Example

Even Odd Number Example This Java Even Odd Number Example shows how to check if the given number is even or odd.

  Output of the program would be

 

0

Calculate Rectangle Area using Java Example

Calculate Rectangle Area using Java Example This Calculate Rectangle Area using Java Example shows how to calculate area of Rectangle using it’s length and width.

Output of Calculate Rectangle Area using Java Example would be...

0

Calculate Rectangle Perimeter using Java Example

Calculate Rectangle Perimeter using Java Example This Calculate Rectangle Perimeter using Java Example shows how to calculate perimeter of Rectangle using it’s length and width.

Output of Calculate Rectangle Perimeter using Java Example would be...

0

Calculate Circle Perimeter using Java Example

Calculate Circle Perimeter using Java Example This Calculate Circle Perimeter using Java Example shows how to calculate Perimeter of circle using it’s radius.

Output of Calculate Circle Perimeter using Java Example would be

 

0

Calculate Circle Area using Java Example

Calculate Circle Area using Java Example This Calculate Circle Area using Java Example shows how to calculate area of circle using it’s radius.

Output of Calculate Circle Area using Java Example would be...