We all know how to write java programs. We also have used english language for doing this. Today, i tried to write a java program in hindi language using eclipse. [For fun only] Lets see how this can done. Below is code sample which can easily be written with any language translator. Actual problem starts […]
HATEOAS is a constraint on REST that says that a client of a REST application need only know a single fixed URL to access it. Any and all resources should be discoverable dynamically from that URL through hyperlinks included in the representations of returned resources.
We have read about checked and unchecked exceptions in java many times. Today, I read about new terms in exception handling in java. Perhaps some of you already knew this, but for others, it is worth knowing. As java differentiate exceptions in two categories on basis of “timing” when they are discovered i.e. checked and […]
Before java 7, while using generics you had to supply type parameters to variables types and to their actual types. Now, it has been relieved a bit in this new java 7 feature, and a blank diamond on right side of declaration will work fine. Compiler is smart enough in java 7 to identify that […]
With release of java 7, oracle has done some good changes in exception handling mechanism also. Primarily these are improved catch block and redundant throws clause. Lets see how they got changed. 1) Improved catch block In this feature, now you can catch multiple exceptions in single catch block. Before java 7, you was restricted […]
If you remember the switch statement before java 7, it supported only int and enum types. Now with java 7 release, support for String class has also been added. Lets see using an example. If interested, you can read about more java 7 features here. Happy Learning !!
If you have ready my previous post about best practices for JUnit testcases, you will find out that writing ordered testcases is considered bad practice. But, still if you caught in a situation where test case ordering is the only way out then you can use MethodSorters class. Lets see how?? MethodSorters is a new […]
As a developer, we all have written Junit testcases at some stage of our career. They are like one strong pillar of your product development life cycle. We have also gone through best practices which are recommended depend on your needs. In this post, I will suggest you another way to test your code units. […]
We all know that easiest way of deep cloning (with some performance overhead) is Serialization. It involves serializing the object to bytes and from bytes to object again. I will suggest you to use in memory deep cloning whenever it is the only need and you don’t need to persist the object for future use. […]
We all know what toString() method does. It returns a string representation of the object. This representation has been made informative for most of the java classes provided in JDK bundle. But still, arrays are one of such exceptions toString() method does not provide any useful information. In this post, we will learn about JDK’s […]