File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Return primitive in getColumnClass? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Return primitive in getColumnClass?" Watch "Return primitive in getColumnClass?" New topic

Return primitive in getColumnClass?

Mark Dary

Joined: Jan 16, 2009
Posts: 29
Hi all

Is is possible to return a primitive in getColumnClass.

I was returning int.class but I kept getting errors, so I changed it to an Integer and it seems OK.

I was just curious if it was actually allowed to return a primitive.


Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535

Not really.
The expected return type is a class object and as you know primitives are well...primitives !

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
It is sorta covered in the JavaRanch Style Guide.
subject: Return primitive in getColumnClass?