Questions tagged «member-hiding»


9
Java名称隐藏:艰难的道路
我有一个很难解决的名称隐藏问题。这是解释问题的简化版本: 有一个类: org.A package org; public class A{ public class X{...} ... protected int net; } 然后有一堂课 net.foo.X package net.foo; public class X{ public static void doSomething(); } 现在,这是有问题的类,它继承自A并希望调用net.foo.X.doSomething() package com.bar; class B extends A { public void doSomething(){ net.foo.X.doSomething(); // doesn't work; package net is hidden by inherited field …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.