Here is my snippet:
public class Test { public static void main(String[] args) { Double doubleValue = 10.000; System.out.println(doubleValue); } }
public class Test { public static void main(String[] args) { Double doubleValue = 10.000; System.out.println( String.format( "%.2f", doubleValue ) ) } }
In Java I am using statement a += b where a is int and b is double, when I use a += b, it won't give error but in case of a = a + b it gives error, why ?
Design an algorithm to accept a string from the user. Count and print the number of times each character occurs in the given string. Example – input string = "malayalam" Output must be – m – 2 a – 4 l – 2 y - 1