Core java
07 JuneDaemon thread in java with example
Daemon threads are low priority background threads which provide services to user threads. It’s life depends on user threads. If no user thread is running then JVM can exit even if daemon threads are running. JVM do not wait for daemon threads to finish. Daemon threads perform background tasks such as garbage collection, finalizer etc. […]
03 JuneHow to remove non-ascii characters from a string in java
In this post, we will see how to remove non ascii character from a string in java. Sometimes, you get non-ascii characters in String and you need to remove them. We will use regular expressions to do it. Java program to remove non-ascii characters: [crayon-6a29f3f71cc8e799373624/] When you run above program, you will get below output: […]
03 JuneConvert HashMap to ArrayList in java
In this post, we will see how to convert HashMap to ArrayList in java. Many times, you need to store keys or values into ArrayList or Store HashMap’s Node objects in ArrayList. HashMap and ArrayList both are the most used data structure in java and both have different Hierarchy. Here are the ways to convert […]
03 JuneHow to check if String has all unique characters in java
Learn about how to check if String has all unique characters in java
03 JuneIgralski vodnik za casino betfury – bonus, dostop in izplačila
This practical guide to Casino betfury focuses on what actually matters: bonuses, mobile access, and getting paid on time. Prerequisites Veljaven e-poštni naslov in telefonska številka. Osebni dokument (osebna izkaznica ali potni list) za preverjanje identitete (KYC). Način plačila: kreditna kartica, e-denarnica (Skrill, Neteller) ali kriptovalute. Stabilna internetna povezava za mobilno igranje. Pripravljenost na morebitne […]
30 MayJava ArrayList indexOf example
ArrayList‘s indexOf method is used to find out first index of object in arraylist. indexOf method takes object as argument and returns first occurrence of specified element. Methods: public int indexOf(Object o) returns index of first occurrence of element in the ArrayList. indexOf method return -1 if object is not present in the ArrayList ArrayList […]
24 MayVariable arguments or varargs methods in java
Java variable arguments was introduced in java 5 and it allows methods to take as many number of arguments you want. Syntax: We use three dots (…) also known as ellipsis to define variable arguments. [crayon-6a29f3f71e3f7945475326/] There are some points which you need to keep in mind while using varargs methods: You can have only […]
24 MayJava String compareTo example
String’s compareTo method compares two String lexicographically. Both String get converted to unicode value and then compares. If you call str1.compareTo(str2) then if it returns positive number : str1 is greater than str2 0: str1 is equal to str2 negative number : str1 is smaller than str2 Java String compareTo example [crayon-6a29f3f71e4c5993495040/] When you run […]
24 MayHow to convert String to Byte array in java
Sometimes, we need to convert String to byte array. We can use getBytes() method of String to do it, Method syntax: [crayon-6a29f3f71e56d430152597/] String getBytes Example: [crayon-6a29f3f71e56f741951278/] When you run above program, you will get below output: [crayon-6a29f3f71e570509460873/] There is one more overloaded method for getBytes Method syntax: [crayon-6a29f3f71e572167168432/] It encodes String to specified charset format. […]