Chandu yadav has Published 1091 Articles

Java program to print Pascal\'s triangle

Chandu yadav

Chandu yadav

Updated on 16-Sep-2024 23:25:11

10K+ Views

In this article we will learn to print Pascal's triangle in Java. Pascal's triangle is one of the classic examples taught to engineering students. It has many interpretations. One of the famous ones is its use with binomial equations. All values outside the triangle are considered zero (0). The first ... Read More

Java program to find if the given number is a leap year?

Chandu yadav

Chandu yadav

Updated on 13-Sep-2024 10:20:55

79K+ Views

In this article, we will learn to find if a year is a leap year or not using Java. Finding whether a year is a leap or not is a bit tricky. We generally assume that if a year number is evenly divisible by 4 is a leap year. But ... Read More

Set a border around navbar with CSS

Chandu yadav

Chandu yadav

Updated on 12-Sep-2024 15:58:40

9K+ Views

To set a border around navbar with CSS, is an easy task and can be easily achieved using CSS properties. In this article, we will learn and understand three different approaches for setting a border around navbar with CSS. We are having a navigation bar with four links in our ... Read More

Java program to check occurrence of each character in String

Chandu yadav

Chandu yadav

Updated on 05-Sep-2024 11:23:51

24K+ Views

To find the occurrence of each character in a string we can use the Map utility of Java. In Map a key cannot be duplicated so make each character of the string a key of Map and provide the initial value corresponding to each key as 1 if this character ... Read More

Java program to determine when a Frame or Window is closing

Chandu yadav

Chandu yadav

Updated on 30-Aug-2024 11:43:36

2K+ Views

In this article, we will learn to determine when a Frame or Window is closing in Java. We will create a simple window in Java Swing titled "Demo". It displays styled text (italic, black on orange) using a text pane inside a scrollable area. The program also listens for window-closing ... Read More

Java object creation of Inherited class

Chandu yadav

Chandu yadav

Updated on 22-Aug-2024 12:12:28

2K+ Views

The constructor is something responsible for the object creation of a particular class in Java. Along with other functions of the constructor, it also instantiates the properties/instances of its class. In Java by default super() keyword is used as the first line of the constructor of every class, here the purpose ... Read More

Java Program to add Combo Box to JTable

Chandu yadav

Chandu yadav

Updated on 19-Aug-2024 18:30:53

2K+ Views

In this article, we will learn how to add a JComboBox to a JTable in Java Swing. The JComboBox allows you to create a drop-down list within a table cell, enabling users to select from predefined options. Steps to add a combo box to JTable Following are the steps to add ... Read More

Java program to swap two integers

Chandu yadav

Chandu yadav

Updated on 16-Aug-2024 23:24:32

3K+ Views

In this article, we will learn to swap two numbers using Java. We will use the Scanner class to get the user input and perform the swapping temporary variable. Read integers from users using the nextInt() method of the Scanner class. Steps to swap two integers Following are the steps ... Read More

Java program to count upper and lower case characters in a given string

Chandu yadav

Chandu yadav

Updated on 24-Jun-2024 17:07:04

10K+ Views

In order to count upper and lower case character we have to first find weather a given character is in upper case or in lower case. For this we would take concept of ASCII value of each character in Java. In Java as we know for each character has corresponding ... Read More

Java program to find the GCD or HCF of two numbers

Chandu yadav

Chandu yadav

Updated on 14-Jun-2024 13:21:32

36K+ Views

An H.C.F or Highest Common Factor, is the largest common factor of two or more values.For example factors of 12 and 16 are −12 → 1, 2, 3, 4, 6, 12 16 → 1, 2, 4, 8, 16The common factors are 1, 2, 4 and the highest common factor is ... Read More

Advertisements