casting int to char using C++ style casting

You should use static_cast<char>(i) to cast the integer i to char. reinterpret_cast should almost never be used, unless you want to cast one type into a fundamentally different type. Also reinterpret_cast is machine dependent so safely using it requires complete understanding of the types as well as how the compiler implements the cast. For more information about C++ casting see: When should static_cast, … Read more

Java Array Sort descending?

You could use this to sort all kind of Objects Arrays.sort() cannot be used directly to sort primitive arrays in descending order. If you try to call the Arrays.sort() method by passing reverse Comparator defined by Collections.reverseOrder() , it will throw the error no suitable method found for sort(int[],comparator) That will work fine with ‘Array of Objects’ such as Integer … Read more