Category Archives: Uncategorized

[Solved] java.lang.ArithmeticException: / by zero in JAVA


java.lang.ArithmeticException is Unchecked exception and sub class of java.lang.RuntimeException. It’s thrown when an exceptional condition occurred in Arithmetic Operations. It can also occurred by virtual ma chine as if suppression were disabled and /or the stack trace was not writable. Examples and How to fix? Continue reading

Advertisements
Posted in Example, Exception, Java, Uncategorized | Tagged , , , , ,

[Solved] NullPointerException In Java


NullPointerException is Runtime Exception and Unchecked Exception which thrown when trying to access an object which is having value as null.
What is Null Value?
Cases when NullPointerException Happen?
How to avoid NullPointerException Continue reading

Posted in Example, Exception, Java, Uncategorized | Tagged , , , , , , , , , ,

How to Swap two Numbers with and with out temporary variable.


How to Swap two Numbers with and with out temporary variable. 1: swap Numbers with temporary variable 2: Swap Numbers without temporary variable by Addition and Subtraction 3: Swap Numbers without temporary variable by multiplication and division Continue reading

Posted in Algorithm, Data Structure, Java, Programming Test, Uncategorized | Tagged , , , , , | 1 Comment

How to exclude fields from JSON while parsing by GSON/GsonBuilder?


exclude fields from JSON while parsing by GSON/GsonBuilder?
@Expose and CustomeExclusionStrategy Continue reading

Posted in GSON, JSON, Uncategorized | Tagged , , , , , , , | 1 Comment

How to do JSON pretty formatting and Null Serialization (GSON/GsonBuilder)


How to do JSON pretty formatting and Null Serialization (GSON/GsonBuilder) Continue reading

Posted in GSON, JSON, Uncategorized | Tagged , , , , , , | 2 Comments

GSON Introduction


Gson is an open source Java library to serialize and de-serialize Java objects to/from JSON. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source code. Continue reading

Posted in GSON, JSON, Uncategorized | 1 Comment

How to Convert JSON data from file to ArrayList?


Example JSON To JAVA ArrayList conversion by Jackson API’s by reading from File Continue reading

Posted in Java, JSON, Uncategorized | Tagged , , , ,

How to Convert JSON to Java Object and Java Object to JSON?


Example JSON To JAVA Object and JAVA Object to JSON conversion by Jackson API’s . Continue reading

Posted in Java, JSON, Uncategorized | Tagged , , , , , ,

Java, How to convert List to Arrays and Array to ArrayList


In our day to day programming sometime use this conversion by using iteration but there is another way by using Java API’s as below. ArrayList to Arrays List provide toArray() method to convert list elements in Arrays. Example : Arrays … Continue reading

Posted in Java, Uncategorized | Tagged , , , , , ,

[Solved] Elasticsearch “high disk watermark exceeded on one or more nodes”


This issue happen on Elasticsearch anytime   because your diskspace storage reached to more than 85% because in elasticsearch by default watermark is 85% of disk storage after reaching this limit elasticsearch stop working and print below warning in logs. Solution : We … Continue reading

Posted in Uncategorized