Single Linked List Program in Java
The Single Linked List Program in Java creates a node, inserts a node, and prints the linked list.
The Single Linked List Program in Java creates a node, inserts a node, and prints the linked list.
Here, we have a basic program example to check if the number is palindrome or not using different languages. A palindrome is a word, number, phrase, or other sequence of symbols that reads the same backwards as forwards, such as “madam”. This program is created in c language, c++, Java, and Python. Code to check…
In the Java program to check if a file or directory has read and write permission or not, we need to import java.io.file library first which contains all the built-in functions than can check the rights to access of a file. Sample Output: /Desktop/sample.txt cannot write. /Desktop/sample.txt cannot read.
In the above Java program to calculate the average value of array elements, we will loop through each element using for loop and then adding and storing the value in sum variable and dividing it by the length of the array. Sample Output: Average value of the array elements is : 50.0
In the above Java program to convert a Roman number to an integer number, we will use if-else ladder. Sample Output: Input a roman value : XVIICM Roman Number: XVIICM Equivalent Integer: 917
In the above Java program to replace all the vowels in a string with a specified character we created a function named validate() and then with the help of a built-in function “replaceAll”, replaced the vowel with passed string. Sample Output: Input the string: lazy frog Original string: lazy frog After replacing vowel(s) with specified…
To understand the above Java program to sort an array of given integers using Merge sort Algorithm, we need to understand what is merge sort. Merge sort is an O (n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in…
In the above Java program to display the current date and time, we have used built-in classes and method to fetch the system date and then passed the month value in getMonthName() function to get the name of the month. sample Output: Current date and time: Friday April 7, 2023 6:4:35