不是很懂这段代码的意思,老师解释一下,谢谢
package com.bjsxt.inherit; //设计一个类代表二维空间的一个圆。要求两个成员变量。一个是圆心,一个是半径提供计算面积的方法。 import java.util.Arrays; public class circle { double x; //圆心的横坐标 double y; //圆心的纵坐标 double r; //圆的半径 public double getR() { return r; } public void setR(double r) { this.r = r; } circle(){ } circle(double x,double y,double r){ double s = Math.PI*getR()*getR(); System.out.println("圆心坐标:("+x+","+y+")"); System.out.println("圆的半径:"+r); System.out.println("圆的面积:"+s); } public static void main(String[] args) { circle c1 = new circle(3.0,5.0,7.0); } }
为什么我计算面积是乘getR(),得出的面积为0。
老师我想随机显示图片,不想按队列更换,用如下代码,结果图片无法更换,请问问题出在哪里了。主要问题我觉得应该是在
var e= Math.random.randint(0,4)
这一句上。但是不知道该怎么改。
<!DOCTYPE html>
<html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> body{ background-image: url(img/mayun.jpg); background-repeat: no-repeat; background-size: 1366px 657px; } a{ font-size: 25px; color: #FFFFFF; } .div1{ width: 300px; height: 200px; background-color: gray; text-align: center; } input{ width: 40px; height: 30px; } </style> <script type="text/javascript"> var i=-1 function changebc(){ var arr=['bjsky.jpg','mayun.jpg','simple.jpg','sxt.jpg','zgc.jpg']; //if (i<arr.length-1){i++;} //else{i=0} var e= Math.random.randint(0,4) document.body.style.backgroundImage="url(img/"+arr[e]+")" }; function changeove(){ var div=document.getElementById("div_1"); div.style.marginLeft=Math.random()*800+'px'; div.style.marginTop=Math.random()*500+'px'; } function changeclk(){ document.body.style.backgroundImage='url(img/1.jpg)'; document.body.style.backgroundSize='1366px 657px'; //设置当前div隐藏 document.getElementById("div_1").style.display="none"; } </script> </head> <body> <a href="javascript:changebc()">点击更换主题</a> <div class="div1" id="div_1"> <h3>我是不是你的小宝贝</h3> <input type="button" name="" id="" value="是" onclick="changeclk()"/> <input type="button" name="" id="" value="否" onmouseover="changeove()"/> </div> </body> </html>
老师,在配置文件里进行了事务的配置,不是就不用在业务层加@Transactional注解了吗?为什么这里还记呢
老师你好,我想请问一下?在真实的开发环境中,有这么多个模块比如api模块,大家各自开发不可能每个人的IDE上都有一个api模块吧,这样的话一改就会都改。我的想法是之前学过Maven的私服,是不是负责人把api接口写好后放到私服上,然后provider项目和consumer项目各自的开发组去连接私服就可以了。也不知道我想得对不对?
老师,抛出异常时,出现异常下面的代码会执行吗
老师,麻烦给我也发一下JDK1.8,谢谢~
好人“与”逻辑,坏人“或”逻辑,可能就是100-1=0吧
请问这个失败重试是之前讲的那个重试机制的高级特性吗,那个也是用retries配置也是默认重试两次,但是讲重试机制的时候并没有说是重试其他服务器
老师讲课中总是说是不是啊,我们没学过,怎么知道是不是
老师,str5打印出来的不也是hello java吗,为什么str2==str5为false,不懂“hello”+" java"和str3+str4的区别
老师,为什么location_id查看不到?
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> .top{height:100px; width:100%; background-color: red;} .tips{width: 100%; height: 40px; background-color: deeppink;} .center{ width: 100%; height: 460px; background-color: palegreen; } .bottom{ width: 100%; height: 150px; background-color: paleturquoise; } .login{ width: 350px; height: 400px; background-color:#ffffff; position: relative; left: 950px; top: 10px; } </style> </head> <body> <div class="top"></div> <div class="tips"></div> <div class="center"> <div class="login"></div> <div></div> </div> <div class="bottom"></div> </body> </html>
空白为什么把上面红色占用来
x=np.array([[1,2,3],[3,4,5]]) display(x) display(x.ndim) y=np.array([[1,2,3],[2,3,4],[3,4,5]]) display(y) display(y.ndim) display(x+y)
老师 这个两行三列的数组为什么和三行三列的数组 不能相加
spring-webflux 5.2.3这个版本依赖有问题,按照楼上的方法可以注册到nacos,但是按照视频测试就会出问题,老师帮忙看看
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637