Java Random nextLong() Method

The nextLong() method of Random class returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.

Syntax

Parameters

NA

Return Value

The nextLong() method returns the next pseudorandom, uniformly distributed long value.

Example 1

Output:

Random Integer value : 3977537424970713389
Random Integer value : 5733671541347552387

Example 2

Output:

7543819037091046117 
-3342512197386667364 
-4465337898535811745 
2349346495373509042 
-6952569592634674749

Example 3

Output:

FirstName-Reema      :  LastName-Panda    : [email protected]         : Id--6149450654700259232
FirstName-Geetanjali :  LastName-Sharma   : [email protected]   : Id--1351029507738091616
FirstName-Vineet     :  LastName-Tanjea   : [email protected]       : Id--2724724873264125475
FirstName-Himanshu   :  LastName-Bhardwaj : [email protected] : Id--2199305912644374368