I have a class that I want to use to store “properties” for another class. These properties simply have a name and a value. Ideally, what I would like...
  • May 20, 2022
  • 0 Comments
Why do generics in Java work with classes but not with primitive types? For example, this works fine: List<Integer> foo = new ArrayList<Integer>(); but this is not allowed: List<int>...
  • May 20, 2022
  • 0 Comments
I’m reading ‘Professional Javascript for Web Developers’ Chapter 4 and it tells me that the five types of primitives are: undefined, null, boolean, number and string. If null is...
  • May 15, 2022
  • 0 Comments
Character.getNumericValue(c) The java.lang.Character.getNumericValue(char ch) returns the int value that the specified Unicode character represents. For example, the character '\u216C' (the roman numeral fifty) will return an int with a value of 50. The letters A-Z...
  • April 8, 2022
  • 0 Comments
You can use the getClass() method to get the type of the object you are using: Object obj = null; obj = new ArrayList<String>(); System.out.println(obj.getClass()); obj = "dummy"; System.out.println(obj.getClass()); obj =...
  • April 7, 2022
  • 0 Comments