Samual Sam has Published 2492 Articles

Deque in Java

Samual Sam

Samual Sam

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

659 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

Java program to check if two given matrices are identical

Samual Sam

Samual Sam

Updated on 26-Jun-2020 05:52:55

1K+ Views

Two matrices are identical if their number of rows and columns are equal and the corresponding elements are also equal. An example of this is given as follows.Matrix A = 1 2 3 4 5 6 7 8 9 Matrix B = 1 2 3 4 5 6 7 8 ... Read More

Merge two sorted arrays in Java

Samual Sam

Samual Sam

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

8K+ 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 subtract week from current date

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:50:00

482 Views

Firstly, you need to import the following package for Calendar class in Java.import java.util.Calendar;Create a Calendar object and display the current date and time.Calendar calendar = Calendar.getInstance(); System.out.println("Current Date and Time = " + calendar.getTime());Now, let us decrement the weeks using the calendar.add() method and Calendar.WEEK_OF_YEAR constant. Set a negative ... 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

97 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

60 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

234 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

TypedArray.values() function in JavaScript

Samual Sam

Samual Sam

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

34 Views

The values() function of the TypedArray returns an iterator object which holds the values of the typed array. The next() method returns the next element in the iterator object.SyntaxIts Syntax is as followstypedArray.values()Example Live Demo    JavaScript Example           var typedArray = new Int32Array([11, ... Read More

TypedArray.toString() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:32:31

31 Views

The toString() function of the TypedArray object returns a string representing the contents of the typed array.SyntaxIts Syntax is as followstypedArray.toString();Example Live Demo    JavaScript Example           var typedArray = new Int32Array([111, 56, 62, 40, 75, 36, 617, 2, 139, 827 ]);     ... Read More

Java program to reverse an array upto a given position

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:29:46

558 Views

An array can be reversed upto the given position pos and the remaining array is unchanged. An example of this is given as follows −Array = 1 2 3 4 5 6 7 8 9 10 Position = 6 Modified array = 6 5 4 3 2 1 7 8 ... Read More

Advertisements