About 592,000 results
Open links in new tab
  1. What are all the different ways to create an object in Java?

    Within the Java language, the only way to create an object is by calling its constructor, be it explicitly or implicitly. Using reflection results in a call to the constructor method, deserialization uses reflection to …

  2. java - Create new object using reflection? - Stack Overflow

    May 6, 2012 · Create new object using reflection? Asked 13 years, 7 months ago Modified 9 years ago Viewed 66k times

  3. How to create correct JSONArray in Java using JSONObject

    In java 6 org.json.JSONArray contains the put method and in java 7 javax.json contains the add method. An example of this using the builder pattern in java 7 looks something like this:

  4. java - How to create JSON Object using String? - Stack Overflow

    Nov 21, 2013 · How to create JSON Object using String? Asked 12 years ago Modified 2 years, 6 months ago Viewed 673k times

  5. Java - How to create new Entry (key, value) - Stack Overflow

    Jun 24, 2010 · 235 Starting from Java 9, there is a new utility method allowing to create an immutable entry which is Map#entry(Object, Object). Here is a simple example:

  6. Create instance of generic type in Java? - Stack Overflow

    Sep 17, 2008 · 7 Java unfortunatly does not allow what you want to do. See the official workaround : You cannot create an instance of a type parameter. For example, the following code causes a …

  7. java - When is it OK to create object of a class inside a method of ...

    Oct 24, 2012 · So, when you create an instance from main method, the constructor is invoked to initialize the state of your instance, and then when the constructor returns, the next statement of your …

  8. java - Creating an instance using the class name and calling ...

    Is there a way to create an instance of a particular class given the class name (dynamic) and pass parameters to its constructor. Something like: Object object = createInstance("mypackage.MyClass","

  9. Create a Path from String in Java7 - Stack Overflow

    How can I create a java.nio.file.Path object from a String object in Java 7? I.e.

  10. java - How to create BLOB object? - Stack Overflow

    Why do you need to create a BLOB object ? Or do you want to read the BLOB data from the DB ?