会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132413个问题
JAVA 全系列/第二阶段:JAVA 基础深化和提高/XML 技术(旧) 36211楼

image.png

怎么把schema文件引进来的?xmlns:xs="http://www.w3.org/2001/XMLSchema",是吧这个复制到根目录后边?

视频里引入的怎么是xmlns:xsi="http://www.w3.org/2001/XMLSchema";xs后边加个i什么意思,还有引入到xml文件,xml文件还写DTD吗,视频里xml文件里还有DTD呢?加了DTD是不是已经验证成功了,引入schema是不是得把DTD的内容删除再验证啊。。。。

JAVA 全系列/第二阶段:JAVA 基础深化和提高/XML 技术(旧) 36213楼

老师,我在执行了maven insatll的命令后出现了一下错误,怎么办

[INFO] Scanning for projects...

[INFO] 

[INFO] -----------------------< com.bjsxt:01mavenDemo >------------------------

[INFO] Building 01mavenDemo 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 01mavenDemo ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 0 resource

[INFO] 

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 01mavenDemo ---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

[INFO] Compiling 2 source files to D:\eclipse\01mavenDemo\target\classes

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR : 

[INFO] -------------------------------------------------------------

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

[INFO] 1 error

[INFO] -------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.842 s

[INFO] Finished at: 2019-09-07T11:00:59+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project 01mavenDemo: Compilation failure

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

[ERROR] -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


JAVA 全系列/(旧的隐藏)第七阶段:JAVA 高级技术/Maven 36214楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/常用类 36216楼

一:问题

老师,如果我想传两个参数加两个默认参数这样写有啥问题吗,代码报错了

image.png

二:报错信息

image.png

三:源码

'''
设计一个名为 MyRectangle 的矩形类来表示矩形。这个类包含
(1) 左上角顶点的坐标:x,y
(2) 宽度和高度:width、height
(3) 构造方法:传入 x,y,width,height。如果(x,y)不传则默认是 0,如果 width和 height 不传,则默认是 100.
(4) 定义一个 getArea() 计算面积的方法
(5) 定义一个 getPerimeter(),计算周长的方法
(6) 定义一个 draw()方法,使用海龟绘图绘制出这个
'''
import turtle as t


class MyRectangle:
    def __init__(self, x=0, y=0, width=0, hight=0, ):
        self.x = x
        self.y = y
        self.width = width
        self.hight = hight

    def getArea(self):
        S = self.width * self.hight
        print("面积是{0}".format(S))

    def getPerimeter(self):
        L = (self.width + self.hight) * 2
        print("周长是{0}".format(L))

    def draw(self):
        t.penup()
        t.goto(self.x, self.y)
        t.pendown()
        t.goto((self.x + self.width), self.y)
        t.goto((self.x + self.width), (self.y - self.hight))
        t.goto(self.x, (self.y - self.hight))
        t.goto(self.x, self.y)
        t.hideturtle()
        t.done()


s = MyRectangle(width=200, higth=80)
s.getArea()
s.getPerimeter()
s.draw()


Python 全系列/第一阶段:Python入门/面向对象 36220楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/IO 流技术(旧) 36221楼
JAVA 全系列/第四阶段:网页编程和设计/CSS3(旧) 36223楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637