BASIC / CATATAN</>↗Basic29 Jan 2019
The ArrayIndexOutOfBoundsException exception is thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array. For example see the code snippet below: String[] vowels = new String[]{"a", "i", "u", "e", "o"} String vowel = vowels[10]; // throws […]
MYSQL / CATATAN</>↗MySQL17 Jan 2019
Introduction There are times when you need to create a user only to have read-only access to a database. The user can view or read the data in the database, but they cannot make any changes to the data or the database structure. Creating a New User Account To create a read-only database user account […]
ECLIPSE / CATATAN</>↗Eclipse16 Jan 2019
Eclipse is the most popular Java Integrated Development Environment (IDE). Just check out the survey result. **Image Source: **IProgrammer Here is one more for you. Image Source Qiita Some people say that Eclipse is dying. However, we can see that many developers still prefer using Eclipse. Let’s get Eclipse popularity part out of the way […]
PROJECT LOMBOK / CATATAN</>↗Project Lombok20 Des 2018
By default, when we use the Lombok’s @Getter and @Setter annotations the getters and setters will be created with public access modifier. We can however change the access modifier by setting the AccessLevel of the @Getter and @Setter annotations. The available choices for the access level are AccessLevel.PUBLIC, AccessLevel.PROTECTED, AccessLevel.PACKAGE, AccessLevel.PRIVATE. These enum values correspond […]
PROJECT LOMBOK / CATATAN</>↗Project Lombok20 Des 2018
The following code snippet show you how to use Project Lombok‘s @Getter and @Setter annotations to generate getters and setters method in your POJO (plain old java objects) classes. Using these annotations remove the need to manually implements the mutator and accessor methods. Although most IDE allows you to generate these methods, using Lombok makes […]
JSON-JAVA / CATATAN</>↗JSON-Java30 Agt 2018
The following code snippet show you how to create JSON string using JSON-Java library. Create an instance of JSONObject and use the put() method to create a key-value pair for the JSON string. The JSONArray object can be used to create an array of list of values to the JSON string, we also use the […]