Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在不同的java包中扩展和修改类——内部解释_Java - Fatal编程技术网

如何在不同的java包中扩展和修改类——内部解释

如何在不同的java包中扩展和修改类——内部解释,java,Java,我需要修改来自不同包的类中的方法 包结构 安德洛伊达普-- 材料表选项卡--- 在材质表激活下,我需要跳过 public void alignSheetWithFab(View fab) { .... if (rightDiff != 0) { // need to remove this block of code ..... } 该方法在MaterialSheetFab protected void morphIntoSheet(final An

我需要修改来自不同包的类中的方法

包结构

安德洛伊达普--

材料表选项卡---

材质表激活下
,我需要跳过

public void alignSheetWithFab(View fab) {
    ....

    if (rightDiff != 0) { // need to remove this block of code 
        .....
    }
该方法在
MaterialSheetFab

protected void morphIntoSheet(final AnimationListener endListener) {

    // Align sheet's position with FAB
    sheetAnimation.alignSheetWithFab(fab);
问题在于
材质表中的成员变量是私有的,因此

public class Sample extend MaterialSheetAnimat{
  ......
  @overide 
  public void AlignSheetWithFab(Fab){
     ....
     //remove code 
     // but cant call any instance variable  there all private 
     // sheet is private member // sheet.setX(fab.coord[0]; not possible
即使扩展类也不允许我重写所插入的代码块

B但问题是materialsheetAnimation中的成员变量是私有的,因此即使扩展类也不允许我重写所插入的代码块

这是
private
成员的定义,您不能覆盖它

B但问题是materialsheetAnimation中的成员变量是私有的,因此即使扩展类也不允许我重写所插入的代码块

这是
private
成员的定义,您不能覆盖它

protected void morphIntoSheet(final AnimationListener endListener) {

    // Align sheet's position with FAB
    sheetAnimation.alignSheetWithFab(fab);
public class Sample extend MaterialSheetAnimat{
  ......
  @overide 
  public void AlignSheetWithFab(Fab){
     ....
     //remove code 
     // but cant call any instance variable  there all private 
     // sheet is private member // sheet.setX(fab.coord[0]; not possible