Articles on Trending Technologies

Technical articles with clear explanations and examples

Java Program for Common Divisors of Two Numbers

AmitDiwan
AmitDiwan
Updated on 18-Nov-2024 813 Views

In this article, we will learn to find the common divisors of two numbers using Java. The program will use a recursive method to calculate the greatest common divisor (GCD) of the two numbers, and then determine how many divisors are shared by both numbers. The output will display the total number of common divisors. Problem Statement Write a Java program to find and count the common divisors of two given numbers. Below is a demonstration of the same − Input val_1= 68 val_2= 34 Output The common divisors between the two numbers is4 Steps to find the common divisors ...

Read More

Java program to print a Fibonacci series

Samual Sam
Samual Sam
Updated on 18-Nov-2024 3K+ Views

The Fibonacci Series generates subsequent numbers by adding two previous numbers. The Fibonacci series starts from two numbers − F0 & F1. The initial values of F0 & F1 can be taken as 0, 1, or 1, 1 respectively. Fn = Fn-1 + Fn-2 Problem Statement Write a program in Java program to print a Fibonacci series. Input Run the program Output 1 1 2 3 5 8 13 21 34 55 The above output is obtained when the values of n=10. Different approaches to print a Fibonacci series Following are the different approaches to printing a Fibonacci series − ...

Read More

Java program to show inherited constructor calls parent constructor by default

Rudradev Das
Rudradev Das
Updated on 18-Nov-2024 469 Views

In this article, we will learn about constructors in Java. Constructors initialize objects when they are created. We will also see how the parent constructor is called in inheritance. Problem StatementWe will demonstrate possible approaches to show how the inherited constructor calls the parent constructor by default.Different approaches The following are the different approaches to show how the inherited constructor calls the parent constructor by default− Demonstrating inheritance properties ...

Read More

Java program to get the current value of the system timer in nanoseconds

karthikeya Boyini
karthikeya Boyini
Updated on 18-Nov-2024 450 Views

In this article, we use the System.nanoTime() method in Java to get the current value of the system timer in nanoseconds. It returns the current value of the most precise available system timer, in nanoseconds. Problem StatementGiven that you need to get the current value of the system timer in nanoseconds, write a Java program that retrieves this value using the System.nanoTime() method.Input There is no specific input as the program retrieves the system's current time in nanoseconds directly.Output Current Value: 49908709882168 nanoseconds Steps to get the current value of the system timer in nanosecondsThe following are the ...

Read More

Java program to get number of elements with odd factors in given range

AmitDiwan
AmitDiwan
Updated on 18-Nov-2024 359 Views

In this article, we will learn how to count the number of elements with odd factors (i.e., perfect squares) in a given range using Java. Perfect squares have odd divisors, and we can calculate them by counting the perfect squares in the specified range. Problem StatementGiven a range defined by a lower and upper bound, write a Java program to calculate how many numbers in this range have odd factors (i.e., perfect squares).Input Lower Range: 55Upper Range: 1000Output The number of elements with odd factors between 55 and 1000 is: 24 Steps to calculate the number of elements with ...

Read More

How to dynamically remove items from ListView on a click?

Nitya Raut
Nitya Raut
Updated on 18-Nov-2024 2K+ Views

This example demonstrate about How to dynamically remove items from ListView on a click Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml.   In the above code, we have taken listview. Step 3 − Add the following code to src/MainActivity.java package com.example.myapplication; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; public class MainActivity extends Activity {  TextView textView;  ArrayAdapter adapter = null;  String[] ...

Read More

How to Use Local Docker Images With Minikube?

jamie macdonald
jamie macdonald
Updated on 18-Nov-2024 168 Views

Why Use a Local Docker ImageYou may find yourself in the position where you will need to test a pod locally for the following reasons:Your organisation does not allow you to submit Docker images to public repositories for intellectual or security reasons  You may not want to have access to your ECR host locally for development You may be just trying something out and want to test it in a local test environment without making it available to the rest of your teamThe first thing you have to do is make sure that you have set the following command.eval $(minikube docker-env)This essentially ...

Read More

Roadmap of Becoming an Elasticsearch Engineer

AYUSH MISHRA
AYUSH MISHRA
Updated on 18-Nov-2024 6K+ Views

Elasticsearch is one of the emerging fields that is used for real-time data analysis, log and data analytics, full-text search, etc. Elasticsearch engineers are responsible for designing, implementing, and maintaining Elasticsearch clusters, ensuring efficient data retrieval, and optimizing search performance. In this article, we are going to discuss how to become an Elasticsearch engineer, what key skills are required, and what future opportunities are.Elasticsearch EngineerElasticsearch is an open-source, distributed search and analytics engine built on top of Apache Lucene. It allows for real-time search capabilities and provides horizontal scalability, high performance, and easy integration with various data sources. Elasticsearch is commonly ...

Read More

Difference Between Laravel and Ruby on Rails

Mithlesh Upadhyay
Mithlesh Upadhyay
Updated on 18-Nov-2024 120 Views

Both Laravel and Ruby on Rails are frameworks used for backend web development. We will discuss what is Laravel, features of Laravel, advantages and disadvantages of Laravel and applications of Laravel. Similarly we will discuss Ruby on Rails in this article. Then we will discuss differences between Laravel and Ruby on Rails.What is Laravel?Laravel is a framework used in backend web development using PHP programming language. Laravel is a open-source framework with model-view-controller design pattern. Laravel reuses existing components of different frameworks. Laravel provides a rich set of functionalities and features. You can learn Laravel framework easily if you know basic and advanced PHP. A website prevents prevents several web attacks ...

Read More

Difference Between Laravel and Spring Boot

Mithlesh Upadhyay
Mithlesh Upadhyay
Updated on 18-Nov-2024 202 Views

We will discuss Laravel and Spring Boot in this article. Both Laravel and Spring Boot are framework used for backend web development. We will discuss what is Laravel, features of Laravel, advantages and disadvantages of Laravel and applications of Laravel. Similarly we will discuss Spring Boot in this article. Then we will discuss differences between Laravel and Spring Boot.What is Laravel?Laravel is a framework used in backend web development using PHP programming language. Laravel is a open-source framework with model-view-controller design pattern. Laravel reuses existing components of different frameworks. Laravel provides a rich set of functionalities and features. You can learn Laravel framework easily ...

Read More
Showing 31671–31680 of 61,297 articles
Advertisements