How To: Configure MachineKey in ASP.NET 2.0
阿新 • • 發佈:2021-06-17
package com.oop; import com.oop.demo04.Person; import com.oop.demo04.Student; import com.oop.demo04.Teacher; /** * <p> * * </p> * * @author: wfs * @date: 2021/6/21 */ public class Application { public static void main(String[] args) { //Object > String //Object >Person>Teacher//Object > Person>Student Object object = new Student(); //System.out.println("X instanceof Y");編譯能不能過,取決於存不存在父子關係 //結果取決於X所指向的實際型別是否為Y的子型別 System.out.println(object instanceof Student);//true System.out.println(object instanceof Person);//true System.out.println(object instanceofObject);//true System.out.println(object instanceof Teacher);//false System.out.println(object instanceof String);//false System.out.println("====================="); Student student = new Student(); System.out.println(student instanceof Student);//true System.out.println(student instanceofPerson);//true System.out.println(student instanceof Object);//true //System.out.println(student instanceof Teacher);//編譯錯誤 // System.out.println(student instanceof String);//編譯錯誤 System.out.println("====================="); Person person = new Student(); System.out.println(person instanceof Student);//true System.out.println(person instanceof Person);//true System.out.println(person instanceof Object);//true System.out.println(person instanceof Teacher);//false // System.out.println(person instanceof String);//編譯錯誤 System.out.println("====================="); } }