1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 17class A4 { 18 public b = 1; 19 #c = 2; 20 constructor() { 21 print("b" in this); 22 } 23} 24let a4 = new A4(); 25 26class B4 { 27 private b = 1; 28 #c = 2; 29 constructor() { 30 print("b" in this); 31 } 32} 33let b4 = new B4(); 34 35class C4 { 36 protected b = 1; 37 #c = 2; 38 constructor() { 39 print("b" in this); 40 } 41} 42let c4 = new C4(); 43 44class D4 { 45 b = 1; 46 #c = 2; 47 constructor() { 48 print("b" in this); 49 } 50} 51let d4 = new D4(); 52