how to take input from user and store it in an object?
I want to use instanceOf on that variable for checking the type of input data
You can either use InputStreamReader or Scanner class to get input from the user and then you can store it in an object.
but it's taking input either as primitive datatype or string. i want to store it in Object variable and then identify the value type using instanceOf.
Yes it takes input as primitive. Do one thing, wrap the primitive to its wrapper class and then you can treat them as Object variable. Wrapper for example, Integer for int.