In this tutorial, we will learn how to create one love calculator program. This program will take two names as inputs, calculates the percentage and prints it out. How the program is calculating the percentage, I am explaining below.
ReadJava JShell was introduced in Java 9. It is an interactive tool for learning Java. It is a Read-Evaluate-Print Loop (REPL) that can be used to evaluate different Java expressions on the terminal.
ReadIn this tutorial, we will learn how to left shift an array in Java . Left shifting by one means the array elements will be moved by one position to left and the leftmost element will be moved to end.
Readset method is used to replace one element in an ArrayList in Java. In this tutorial, I will show you how to use set method with one example.
Readconcat() method is used to join two strings. It concatenates one string to the end of another string. This method is defined as below :.
ReadJava provides a utility class called LinkedList to create linked lists. Unlike any other programming languages like C, we can create one Linked list easily using this class.
ReadUsing LinkedList class, we can create one linked list in Java. This class provides a lot of different methods to operate on the elements of the linked list. In this tutorial, we will check three inbuilt methods peek(), peekFirst() and peekLast() of the LinkedList class.
ReadVector is a good replacement of array in Java if you want to add elements dynamically. We can add elements dynamically to a vector and it will increase its size, unlike arrays. Previously we have learned different examples of vectors like [how to create vectors](https://www.codevscolor.com/java-print-vector-contents), how to [add elements to a vector](https://www.codevscolor.com/add-elements-to-java-vector-using-index) and how to [clear a vector](https://www.codevscolor.com/how-to-clear-vector-in-java). In this tutorial, we will learn how to add elements to a vector in a specific position, i.e. using index numbers.
ReadSometimes we need to compare two substrings in different string in Java. We can do that by comparing each character one by one of both strings but Java String class comes with a built-in method called regionMatches to make this task easier.
ReadIn this tutorial, we will learn how to use enumeration to iterate over a vector in Java. Our program will first take the inputs for the vector from the user, it will then print out the inputs using enumeration.
Read