Karthikeya Boyini has Published 2193 Articles

Scraping and Finding Ordered Word in a Dictionary in Python

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:37:10

673 Views

For solving this problem we need requests module.For installing requests module, we need this command to get executed at command line.pip install requestsScrapingImport requests module.Then we need to fetch data from URL.Using UTF-8 decode the text.Then convert string into a list of words.Ordered FindingTraverse the list of words using loop.Then ... Read More

Comparison of Float in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:34:33

332 Views

To compare Float in Java, use the following methods −Method 1 − compareTo(newFloat) method in JavaThe java.lang.Float.compareTo() method compares two Float objects. This method returns the value 0 if the new float value is numerically equal to this Float; a value less than 0 if this Float is numerically less ... Read More

Convert string to char array in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:21:40

4K+ Views

The following is our string.String str = "Tutorial";Now, use the toCharArray() method to convert string to char array.char[] ch = str.toCharArray();Now let us see the complete example.Example Live Demopublic class Demo {    public static void main(String []args) {       String str = "Tutorial";       System.out.println("String: "+str); ... Read More

Determine if a String is a legal Java Identifier

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:20:41

880 Views

To determine if a String is a legal Java Identifier, use the Character.isJavaIdentifierPart() and Character.isJavaIdentifierStart() methods.Character.isJavaIdentifierPart()The java.lang.Character.isJavaIdentifierPart() determines if the character (Unicode code point) may be part of a Java identifier as other than the first character.A character may be part of a Java identifier if any of the following ... Read More

Creating child process using fork() in Python

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:19:41

2K+ Views

Our task is to create a child process and display process id of both parent and child process using fork() function in Python.When we use fork(), it creates a copy of itself, it is a very important aspect of LINUX, UNIX. fork() is mainly applicable for multithreading environment that means ... Read More

Java Program to validate if a String contains only numbers

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:17:33

2K+ Views

To validate if a String has only numbers, you can try the following codes. We have used the matches() method in Java here to check for number in a string.Example Live Demopublic class Demo {    public static void main(String []args) {       String str = "978";     ... Read More

Check whether the entered value is whitespace or not in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:14:28

4K+ Views

To check whether the entered value is whitespace or not in Java, use the Character.isWhitespace() method.We have a value to be checked.char val = ' ';Now let us use the Character.isWhitespace() method.if (Character.isWhitespace(val)) {    System.out.println("Value is a Whitespace!"); } else {    System.out.println("Value is not a Whitespace"); }Let us ... Read More

Store unicode in a char variable in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 12:10:49

1K+ Views

To store Unicode in a char variable, simply create a char variable.char c;Now assign unicode.char c = '\u00AB';The following is the complete example that shows what will get displayed: when Unicode is stored in a char variable and displayed.Example Live Demopublic class Demo {    public static void main(String []args) { ... Read More

Java Program to wrap a Primitive DataType in a Wrapper Object

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:56:21

419 Views

Every Java primitive data type has a class dedicated to it. These classes wrap the primitive data type into an object of that class. Therefore, it is known as wrapper classes.The following is the program that displays a Primitive DataType in a Wrapper Object.Example Live Demopublic class Demo {    public ... Read More

Parse and format to hexadecimal in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 10:54:48

282 Views

To parse and format to hexadecimal in Java, we have used the BigInteger class. The java.math.BigInteger class provides operations analogues to all of Java's primitive integer operators and for all relevant methods from java.lang.Math.In the below example, we have taken BigInteger and created an object. With that, some values have ... Read More

Advertisements