Samual Sam has Published 2310 Articles

Java Program to convert float to String

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:30:12

300 Views

The valueOf() method is used in Java to convert float to string.Let’s say we have the following float value.float val = 10.18465F;Converting the above float value to string.String.valueOf(val);Example Live Demopublic class Demo {    public static void main(String[] args) {       float val = 98.18465F;       // ... Read More

How to add Scalable Vector Graphics (SVG) to your Web Page?

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:30:10

236 Views

SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.Note: If you already have an ... Read More

Convert short to String in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:28:00

5K+ Views

The valueOf() method is used in Java to convert short to string.Let’s say we have the following short value.short val = 20;Converting the above short value to string.String.valueOf(val);Example Live Demopublic class Demo {    public static void main(String[] args) {       short shortVal = 55;       // ... Read More

Java Program to convert a Primitive Type Value to a String

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:23:50

3K+ Views

For converting a primitive type value to a string in Java, use the valueOf() method.Let’s say we want to convert the following double primitive to string.double val4 = 8.34D;For that, use the valueOf() method. It converts it into a string.String str4 = String.valueOf(val4);Example Live Demopublic class Demo {    public static ... Read More

Multiplication of two Matrices using Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:22:34

7K+ Views

Matrix multiplication leads to a new matrix by multiplying 2 matrices. But this is only possible if the columns of the first matrix are equal to the rows of the second matrix. An example of matrix multiplication with square matrices is given as follows.Example Live Demopublic class Example {    public ... Read More

Deque in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:18:01

926 Views

The dequeue is a double ended queue and data elements can be added or removed from either end. The dequeue in Java is implemented using the java.util.Deque interface which is a subtype of the java.util.Queue interface.A program that demonstrates some of the methods of a dequeue is given as follows ... Read More

Merge two sorted arrays in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 14:09:13

9K+ Views

Two sorted arrays can be merged so that a single resultant sorted array is obtained. An example of this is given as follows.Array 1 = 1 3 7 9 10 Array 2 = 2 5 8 Merged array = 1 2 3 5 7 8 9 10A program that demonstrates ... Read More

Java Program to check whether the entered character is ASCII 7 bit numeric and character

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:44:38

156 Views

To check whether the entered value is ASCII 7-bit numeric and character (alphanumeric), check the characters ASCII value for −A to Z Or a to z Or 0 to 9Here, we have the following value −char one = '5';Now, we have checked some conditions with if-else for ASCII 7-bit numeric ... Read More

TypedArray.slice() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:36:07

90 Views

The slice() method of the typed array object returns a portion or, chunk from the array buffer (as a separate object). It accepts two integer arguments representing the start and end of the portion of the array to be returned.SyntaxIts Syntax is as followsarrayBuffer.slice(3, 8)Example Live Demo    JavaScript Array ... Read More

Java Program to check whether the character is ASCII 7 bit printable

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:33:17

339 Views

To check whether the entered value is ASCII 7-bit printable, check whether the characters ASCII value is greater than equal to 32 and less than 127 or not. These are the control characters.Here, we have a character.char one = '^';Now, we have checked a condition with if-else for printable characters.if ... Read More

Advertisements