Samual Sam has Published 2492 Articles

Java Program to check whether the character is ASCII 7 bit

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:11:17

302 Views

To check whether the character is ASCII 7 bit or not, check whether given value’s ASCII value is less than 128 or not.Here, we have a character.char one = '-';Now, we have checked a condition with if-else for ASCII 7-bit character.if (c < 128) { System.out.println("Given value is ASCII 7 ... Read More

Stack in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:05:40

1K+ Views

A stack class is provided by the Java collection framework and it implements the Stack data structure. The stack implements LIFO i.e. Last In First Out. This means that the elements pushed last are the ones that are popped first.The following are some of the methods.Sr.NoMethods & Description1boolean empty()Tests if ... Read More

Keywords in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:04:17

661 Views

Keywords in Java are reserved words that represent predefined actions, internal processes etc. Because of this, keywords cannot be used as names of variables, functions, objects etc.The main difference between keywords and identifiers is that keywords are reserved words that represent predefined actions while identifiers are the names of variables, ... Read More

Different Methods to find Prime Number in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:03:02

2K+ Views

A prime number is a number that is only divisible by one or itself. Some of the prime numbers are 2, 3, 5, 7, 11, 13 etc.Some of the different methods to find a prime number in Java are given as follows −Method 1 - Find if a number is ... Read More

Java Program to check whether the entered value is ASCII 7-bit alphabetic lowercase

Samual Sam

Samual Sam

Updated on 26-Jun-2020 06:57:14

119 Views

To check whether the entered value is ASCII 7-bit alphabetic lowercase, check the character from ‘a’ to ‘z’.Here, we have a character.char one = 'm';Now, we have checked a condition with if-else to check for lowercase character from ‘a’ to ‘z’if (one >= 'a' && one = 'a' && one ... Read More

Java Program to convert float to String

Samual Sam

Samual Sam

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

211 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

158 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

4K+ 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

2K+ 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

4K+ 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

Advertisements