harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy,Jing Lv" <firep...@gmail.com>
Subject Re: [classlib][lang] Is it possible to new an object without invoking any constructor?
Date Thu, 15 Nov 2007 05:22:23 GMT
A simple thought is using the JNI call AllocObject(JNIEnv *env, jclass clazz);
however we need to implement a native api then :)

2007/11/15, Andrew Zhang <zhanghuangzhu@gmail.com>:
> Hi,
>
> Is it possible to new an object without invoking any constructor? I know the
> question is a bit weird. What I want is to create an object with all
> null/default value for its fields.
> Reseting all fields to null by reflection is a possible solution, but is
> there any existing special method (no matter it's low level or Harmony
> specific) which can achieve this goal?
> Thanks!
>
>
> --
> Best regards,
> Andrew Zhang
>
> http://zhanghuangzhu.blogspot.com/
>


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

Mime
View raw message