C++中类型强转可以用(TypeName) 和dynamic_cast<Type>() C#中有两种方法 is 和 as public class Boy{ }public class Girl{ }void Main(){Object boy = new Boy();// 使用isif (boy is Boy) {Boy b = (Boy)boy;}// 使用asBoy b
1.int和char比较 public static void main(String[] args) {char x = 'x';int i = 10;char y = '2';System.out.println(true? x: i);System.out.println(true? 'x': 1167);System.out.println(true?y:2);System.out