Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
System.ConvertJava に相当するもの、または.NETと同じことを行う型を持つ Java ライブラリはありますか?
System.Convert
Objectを受け取り、整数、長整数、文字列などに変換できるメソッドが必要です。独自のメソッドを簡単に作成できますが、ライブラリで使用することをお勧めします...
Object
よくわかりませんが、JAVA では同等ではないと思います。
ただし、このソリューションをテストできます:
public String convertString(Object oject1) { if ( oject1 instanceof Integer) { /// convert method return stringConvert } if ( oject1 instanceof Long) { /// Convert method } ...... }