Arjun Thakur has Published 1109 Articles

Random vs Secure Random numbers in Java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:15:38

3K+ Views

Java provides two classes for having random numbers generation - SecureRandom.java and Random.java.The random numbers can be used generally for encryption key or session key or simply password on web server.SecureRandom is under java.security package while Random.java comes under java.util package.The basic and important difference between both is SecureRandom generate ... Read More

static Keyword in Java programming

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:12:49

184 Views

The Static ModifierStatic VariablesThe static keyword is used to create variables that will exist independently of any instances created for the class. Only one copy of the static variable exists regardless of the number of instances of the class.Static variables are also known as class variables. Local variables cannot be ... Read More

Java Program to fill elements in a char array

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:08:07

607 Views

Elements can be filled in a char array using the java.util.Arrays.fill() method. This method assigns the required char value to the char array in Java. The two parameters required are the array name and the value that is to be stored in the array elements.A program that demonstrates this is ... Read More

Primitive Wrapper Classes are Immutable in Java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:06:49

1K+ Views

In Java Immutable class is a class which once created and it's contents can not be changed.On same concept Immutable objects are the objects whose state can not be changed once constructed.Wrapper classes are made to be immutable due to following advantages −Since the state of the immutable objects can ... Read More

The most Common POSIX System Calls in Python

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:04:38

663 Views

The posix module is works on the UNIX environment. It provides the Operating system functionality.We should not import this module directly. We can use the os module. The os module is acts as a superset of the posix module on UNIX. On non-Unix system the posix is not available, but ... Read More

Generate Random Long type numbers in Java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:04:27

4K+ Views

In order to generate Random long type numbers in Java, we use the nextLong() method of the java.util.Random class. This returns the next random long value from the random generator sequence.Declaration − The java.util.Random.nextLong() method is declared as follows −public long nextLong()Let us see a program to generate random long ... Read More

Find the Package of an Object in Java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 14:00:45

754 Views

The package for an object of a class can be obtained using the getPackage() method with the help of the class loader of the class. If there is no package object created by the class loader of the class, then null is returned.A program that demonstrates this is given as ... Read More

Python Support for gzip files (gzip)

Arjun Thakur

Arjun Thakur

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

12K+ Views

GZip application is used for compression and decompression of files. It is a part of GNU project. Python’s gzip module is the interface to GZip application. The gzip data compression algorithm itself is based on zlib module.The gzip module contains definition of GzipFile class along with its methods. It also ... Read More

MySQL query to select records with a particular date and time?

Arjun Thakur

Arjun Thakur

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

2K+ Views

You can use BETWEEN clause from MySQL to select records with a particular date and time. The syntax is as follows.select *from AllRecordsFromadate where AdmissionDate between 'yourDateTimeValue1 ' and ''yourDateTimeValue2';To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create ... Read More

Get the Name of a Member Object in Java

Arjun Thakur

Arjun Thakur

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

4K+ Views

The getName() method is used to get the names of the entities such as interface, class, array class, void etc. that are represented by the class objects. These names are returned in the form of a string.A program that gets the name of the member objects using getName() method is ... Read More

Advertisements