What is Java String interning?

http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#intern() Basically doing String.intern() on a series of strings will ensure that all strings having same contents share same memory. So if you have list of names where ‘john’ appears 1000 times, by interning you ensure only one ‘john’ is actually allocated memory. This can be useful to reduce memory requirements of your program. But … Read more

Getting java.net.SocketTimeoutException: Connection timed out in android

I’ve searched all over the web and after reading lot of docs regarding connection timeout exception, the thing I understood is that, preventing SocketTimeoutException is beyond our limit. One way to effectively handle it is to define a connection timeout and later handle it by using a try-catch block. Hope this will help anyone in future who are facing … Read more

How to import a .cer certificate into a java keystore?

If you want to authenticate you need the private key – there is no other option. A certificate is a public key with extra properties (like company name, country,…) that is signed by some Certificate authority that guarantees that the attached properties are true. .CER files are certificates and don’t have the private key. The private … Read more

How to remove single character from a String

You can also use the StringBuilder class which is mutable. It has the method deleteCharAt(), along with many other mutator methods. Just delete the characters that you need to delete and then get the result as follows: This avoids creation of unnecessary string objects.

How to remove single character from a String

You can also use the StringBuilder class which is mutable. It has the method deleteCharAt(), along with many other mutator methods. Just delete the characters that you need to delete and then get the result as follows: This avoids creation of unnecessary string objects.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)