Thursday , July 7 2022
Home / Java / JAVA #27 Object Type in Java

JAVA #27 Object Type in Java

Hede October 15, 2015 Java Leave a comment 1,184 Views


single-handed Object Type in Java

  • An object is a class instance or an array.
  • The reference values (often just references) are pointers to these objects, and a special null reference, which refers to no object.
  • A class instance is explicitly created by a class instance creation expression .
  • An array is explicitly created by an array creation expression.
  • A new class instance is implicitly created when the string concatenation operator + is used in a non-constant expression, resulting in a new object of type String .
  • A new array object is implicitly created when an array initializer expression is evaluated; this can occur when a class or interface is initialized , when a new instance of a class is created , or when a local variable declaration statement is executed .
  • New objects of the types Boolean, Byte, Short, Character, Integer, Long, Float, and Double may be implicitly created by boxing conversion .


// File name
package objectdatatype;
public class ObjectDataType {
    public static void main(String[] args) {
        classValue objVal = new classValue();
        objVal.write(new Float(23.24));

class classValue
    private Object storeValue;
    public void write(Object val) // Setter Function
        storeValue = val;
    public Object read() // Getter Function
        return storeValue;


About Faheem

An adaptable and responsible Software Engineer, who enjoys working with computers and the opportunity to learn new skills and work with new technologies is particularly attractive to me.

Check Also

JAVA #32 – Java application using SQL server (Part: 01)

  In this part we made the GUI front end of a Application.

Leave a Reply

Your email address will not be published.