一、代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> var a=1; var b=1.2; var c='你好' var d=new Data(); var e=true; alert(typeof a) </script> </head> <body> </body> </html> <!-- -->
二、老师请问,我这一行代码运行为啥没有反应?
'''定义一个 Employee 雇员类,要求如下: (1) 属性有:id、name、salary (2) 运算符重载+:实现两个对象相加时,默认返回他们的薪水和 (3) 构造方法要求:输入 name、salary,不输入 id。id 采用自增的方式,从 1000 开始自增,第一个新增对象是 1001,第二个新增对象是 1002 (4) 根据 salary 属性,使用@property 设置属性的 get 和 set 方法。set 方法要求输入:1000-50000 范围的数 ''' class Employee: count=0 id=1000 def __init__(self,name,salary): self.__name=name self.__salary=salary Employee.count=Employee.count+1 Employee.id=Employee.id+1 @property def salary(self): return self.__salary @salary.setter def salary(self,salary): if 1000<salary<50000: self.__salary=salary else: print('录入错误,请重新录入') a1=Employee('小千千',30090) a2=Employee('小来来',45890) a1.salary a2.salary print('一共{0}个Employee'.format(Employee.count)) print('一共{0}个id'.format(Employee.id))
老师:
你好
你看这道题的括号二怎么写呀?
而且。如果我有多个Mapper.xml文件里面都有延迟加载,我调用配置的方法时,时所有的延迟夹杂爱都会触发么?
请问这个项目有技术文档吗,怎么一步步搭建的,涉及哪些事情啊,如果我非要自己一步步来,有什么建议呢
from threading import Thread from queue import Queue from time import sleep def producter(): num = 1 while True: print(f'生产第{num}个手机') mq.put(f'消费了第{num}个手机') num+=1 sleep(1) def consumer(): while True: m = mq.get() print(m) # sleep(1) if __name__ == '__main__': mq=Queue() t1=Thread(target=producter) t2=Thread(target=consumer) t1.start() t2.start()
老师我为啥找不到
DataFromNet
这个库呢
老师我在.yml文件里配置了端口是8888,在.properties文件里配置端口是9999理论上重启之后应该端口是9999呀,但我这为什么还是8888
#ffsfs a = 0 sum_a = 0 while a <=100 and a%2 ==1: sum_a += a a +=1 print("1-100所有奇数的累加和为:",sum_a)
class BaseItem(pygame.sprite): def __init__(self,color,width,height): pygame.sprite.Sprite.__init__(self) 报错## File "C:/Users/HP/PycharmProjects/mypy001/python第二章/my python 02-04.py", line 9, in <module> class BaseItem(pygame.sprite): TypeError: module.__init__() takes at most 2 arguments (3 given)
collapse这个单词什么意思solid black又是什么意思
启动报错老师!帮忙看一下
以下是源码!
多谢老师!
springbootmybatis.zip
老师这里怎么设置的?
package com.bjsxt.utils; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import java.io.IOException; import java.io.InputStream; public class MybatisUtils { private static ThreadLocal<SqlSession> threadLocal=new ThreadLocal<>(); private static SqlSessionFactory sqlSessionFactory= null; static { //创建SqlsessionFactory InputStream is=null; try{ is= Resources.getResourceAsStream("mybatis-cfg.xml"); }catch(IOException e){ e.printStackTrace(); } // sqlSessionFactory=new SqlSessionFactoryBuilder().build(is); sqlSessionFactory = new SqlSessionFactoryBuilder().build(is); } //获取SqlSession public static SqlSession getSqlSession(){ SqlSession sqlSession=threadLocal.get(); if(sqlSession==null){ sqlSession=sqlSessionFactory.openSession(); threadLocal.set(sqlSession); } return sqlSession; } //关闭SqlSession public static void closeSqlSession(){ SqlSession sqlSession=threadLocal.get(); if(sqlSession!=null){ sqlSession.close(); threadLocal.set(null); } } }
这块代码有错吗 第一次运行的时候没错 但是每次都显示错误 找了半天也没找到
package com.itbaizhan; class Iphone{ private String name; public Iphone(String name){ this.name=name; } public void show(){ System.out.println("我是 "+name+"可以在屏幕上显示"); } } class touyingPhone{ public Iphone iphone; //它只是个扩展,必须有前一个东西才能扩展。这里的Iphone,就是继承于Iphone的意思。iPhone是参数 public touyingPhone(Iphone iphone){ this.iphone=iphone; } //功能更强的 方法 public void show(){ iphone.show(); System.out.println("还能投影,在墙上"); } } public class TestDecoration { public static void main(String[] args) { Iphone i=new Iphone("苹果199代"); i.show(); System.out.println("======加上装饰器后======"); touyingPhone typ=new touyingPhone(Iphone); typ.show(); } }
这个报错实在是找不到该怎么解决,视频看了两遍了都没头绪
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637