Karthikeya Boyini has Published 2193 Articles

Java Program to check for Integer overflow

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:09:42

7K+ Views

To check for Integer overflow, we need to check the Integer.MAX_VALUE, which is the maximum value of an integer in Java.Let us see an example wherein integers are added and if the sum is more than the Integer.MAX_VALUE, then an exception is thrown.Example Live Demopublic class Demo {    public static ... Read More

Display the maximum of three integer values in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:08:31

221 Views

The following is an example displaying the maximum of three integer values.Example Live Demopublic class Demo {    public static void main(String[] args) {       int val1 = 10;       int val2 = 20;       int val3 = 30;       System.out.println("Number 1 = ... Read More

Display the minimum and maximum value of primitive data types in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:05:50

3K+ Views

Every data type in Java has a minimum as well as maximum range, for example, for Float.Min = 1.4E-45 Max = 3.4028235E38Let’s say for Float, if the value extends the maximum range displayed above, it leads to Overflow.However, if the value is less than the minimum range displayed above, it ... Read More

Boolean Type in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:04:35

13K+ Views

To display Boolean type, firstly take two variables and declare them as boolean.boolean val1, val2;Then one by one assign values to both of them, one of them is shown below −val1 = true;Now, use if statement to check and display the Boolean true value.if(val1) System.out.println("This is true and will get ... Read More

String representation of Boolean in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:03:36

589 Views

To get the string representation of Boolean, use the toString() method.Firstly, we have used the valueOf() method for Boolean object and set a string value.Boolean val = Boolean.valueOf("false");The same is then represented using “toString() method.val.toString();Let us see the complete example that prints the string representation of Boolean (True and False) ... Read More

zip_entry_compressionmethod() function in PHP

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:02:29

56 Views

The zip_entry_compressionmethod() function returns the compression method of a zip archive entry.Syntaxzip_entry_compressionmethod()Parameterszip_entry − The zip entry resource. Required.ReturnThe zip_entry_compressionmethod() function returns the compression method of a zip archive entry.The following is an example. Let’s say we have 3 files in our zip archive "new.txt", therefore the compression method for all ... Read More

zip_entry_name() function in PHP

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 09:57:57

71 Views

The zip_entry_name() function returns the name of the zip archive file.Syntaxzip_entry_name(zip_entry)Parameterszip_entry − A zip file opened with zip_open() is to be mentioned here.ReturnThe zip_entry_name() function returns the name of the zip archive file.The following is an example. Let’s say we have 5 files in the zip archive "new.zip".ExampleOutputFile Name = ... Read More

zip_entry_close() function in PHP

karthikeya Boyini

karthikeya Boyini

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

71 Views

The zip_entry_close() function is used to close a zip archive opened by the zip_entry_open() function.Syntaxzip_entry_close(zip_entry)Parameterszip_entry − The zip entry resource. Required.ReturnThe zip_entry_close() function Returns TRUE on success and FALSE on failure.The following is an example. Let’s say we have "new.zip" file as our archive.ExampleRead More

is_nan() function in PHP

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 09:51:50

87 Views

The is_nan() function checks for ‘not a number’ value. It Returns TRUE if num is 'not a number', else FALSE is Returned.Syntaxis_nan(num)Parametersnum − The value to checkReturnThe is_nan() function Returns TRUE if num is 'not a number', else FALSE is Returned.ExampleLet us see another example −ExampleRead More

decoct() function in PHP

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 09:49:13

90 Views

The decoct() function converts a decimal number to an octal. It Returns an octal string of the specified decimal.Syntaxdecoct(num)Parametersnum − The decimal value to convert.ReturnThe decoct() function Returns an octal string of the specified decimal.Example Live DemoOutput106Let us see another example −Example Live DemoOutput72547141460

Advertisements