May be the title will misguide you.
String str ="abcd";
In the above code String is a class and without using new we can create an object with value. Now I have a class Number.java in which I have to assign some number as shown below.
Number no = 23;
How to create such class.
I would normally say that you should be using Operator Overloading. But this feature does not exist in Java.
See here: Operator overloading in Java