Latest :

Author Archives: Writer - MK

Java Program To Subtract Two Matrices – 3 Ways

Java program for matrix subtraction. The following Java code to subtract two matrices has been written in three different ways. For addition you can check here, The methods are: Using For Loop Using While Loop Using Do-While Loop The compiler has been added to the program so that you can execute and check it for yourself, along with suitable examples ...

Read More »

Java Program: Calculate Roots of Quadratic Equation | Java Programs

Java program to calculate roots of the quadratic equation – The following program has been written in 2 simple ways. A quadratic equation is of the form ax2+bx+c=0 where a,b,c are known numbers while x is the unknown. Our problem statement is to write a code to find the roots of this equation. Roots of the equation are the values ...

Read More »

Java : Convert Character to ASCII in 2 Ways | Java Programs

Java print and Convert Char to ASCII in Java program in 2 different ways. The converted character to ASCII Java program will be given with sample output and suitable examples. ASCII is an acronym for American Common Code For Information Interchange. It is a standard data-transmission code used by smaller and less powerful computers to convey both textual data (letters, ...

Read More »

Java Program To Check Any Spaces In a String | Java Programs

Check String for Spaces in Java Program – In this specific article, we will be dealing with the code here to check whether a given string has a white space using Java language with suitable examples and sample output. The problem here is to check whether a user-defined string has a whitespace present. Our constraint here is the inability to ...

Read More »

Java Thread By Extending Thread Class – Java Tutorials

Java Thread by extending Thread class – Here we cover the complete tutorial and examples for java thread by extending thread class. Generally, thread facilities are provided to a class in two ways: By extending Thread By implementing Runnable In this page, we just concentrate more on extending Thread rather than implementing Runnable. The class Thread helps to achieve multi ...

Read More »

How to Read All Elements In Vector By Using Iterator

Java program & tutorial to read all elements in a vector by using iterator. Here, we have discussed the various methods to do the aforementioned using sample program & Example. Compiler has been added so that you can execute the programs yourself, alongside suitable examples and sample outputs. To travel through a Vector, we can use any of the following ...

Read More »

Remove An Element From Collection Using Iterator Object In Java

Java tutorial to remove an element from collection using Iterator object. Here, we will discuss about the methods to remove an element from a collection using iterator objects in Java alongside suitable examples and sample outputs. Also we have discussed what is an Iterator in brief. The methods are as follows: Removing All Elements. Removing A Specific Element Removing Using ...

Read More »

Java Program to Calculate Entropy 2 Ways | Java Programs

Java program to calculate entropy in 5 ways. Entropy, in short, is the average level of information or uncertainty in a particular variable’s possibility of outcomes. Our problem statement here is, to write a code to find the entropy of a number of messages. For this, our required inputs are, the number of messages (n) and the probability of each ...

Read More »

Java Program to Calculate Variance & Standard Deviation | Java Programs

To solve any given problem, we first have to understand the problem statements thoroughly and see if any constraints are given in the problem. Then, we have to determine the requirements or inputs needed to solve the problem. Then, we decide our expected output for the given problem and finally, think of the logic to be used to arrive at ...

Read More »

Copying Character Array To String In Java – Tutorial

Java tutorial to copy character array to string. Here, we will discuss about the various methods of copying a character array to a string using. If you have any doubts leave a comment here at the end of the post. Creating a string object based on the character array. Adding character by character to an initially empty string. Setting character ...

Read More »