⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myshape.java

📁 java内部类的原代码
💻 JAVA
字号:
package firstpkg;public class MyShape extends java.lang.Object implements ShapePrintable {        protected MyColor m_ForeColor ;    protected MyColor m_BackGroundColor ;    protected int m_LineBroad;        /** Creates a new instance of Shape */    public MyShape() {        this.m_ForeColor=new MyColor("black");        this.m_BackGroundColor=new MyColor("white");        this.m_LineBroad=2;    }          public String getBackGroundColor() {        return this.m_BackGroundColor.getColorString();    }            public void setBackGroundColor(String newBackGroundColor) {        this.m_BackGroundColor.setColorString(newBackGroundColor);    }        public String getForeColor() {        return this.m_ForeColor.getColorString();    }            public void setForeColor(String newForeColor) {        this.m_ForeColor.setColorString(newForeColor);    }        public int getLineBroad() {        return this.m_LineBroad;    }        public void setLineBroad(int newLineBroad) {        this.m_LineBroad=newLineBroad;    }        public void printBackGroundColor() {        System.out.println("The BackGroundColor of MyShape Object is:  "+this.getBackGroundColor());    }        public void printForeColor() {          System.out.println("The ForeColor of MyShape Object is:  "+this.getForeColor());       }        public void printLineBroad() {          System.out.println("The LineBroad of MyShape Object is:  "+this.getLineBroad());       }        public  class MyColor     {         public String m_ColorString;        public MyColor(String ColorString)        {            this.m_ColorString=ColorString;        }        public String getColorString()        {            return this.m_ColorString;        }        public void setColorString(String newColorString)        {            this.m_ColorString=newColorString;        }    }           }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -