方式一、使用java脚本 <% Long time = (Long)request.getAttribute("longtime"); Date date=new Date(time); SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy ...
分类:
Web程序 时间:
2019-11-08 12:13:57
阅读次数:
159
知识点;1、生成子类的过程2、使用super调用父类构造函数的方法 首先编写3个文件。 Person.java class Person{ String name; int age; Person(){ System.out.println("None"); } Person(String name ...
分类:
编程语言 时间:
2019-11-07 17:39:22
阅读次数:
91
1、快速开始 1.1 定义神经网络类,继承torch.nn.Module,文件名为digit_recog.py import torch.nn as nnclass Net(nn.Module): def __init__(self): super(Net, self).__init__() sel ...
分类:
其他好文 时间:
2019-11-07 13:29:33
阅读次数:
90
2.3 super关键字 ①super不是引用类型,super中存储的不是内存地址,super指向的不是父类对象. ②super代表的是当前子类对象中的父类型特征。 ③什么时候使用super? 类和父类中都有某个数据,例如,子类和父类中都有name这个属性。如果要再子类中访问父类中的name属性,需 ...
分类:
编程语言 时间:
2019-11-07 09:53:11
阅读次数:
77
MyService.class public class MyService extends Service { public MyService() { } // 创建一个服务 @Override public void onCreate() { super.onCreate(); } // 服务 ...
分类:
移动开发 时间:
2019-11-07 09:16:35
阅读次数:
97
//原型链继承 function SuperType(){ this.name = 'super'; this.girlFriends = ["xiaoli","xiaowang"]; } SuperType.prototype.sayName = function(){ console.log(t ...
分类:
编程语言 时间:
2019-11-06 13:46:52
阅读次数:
72
Stories (myths) may then grow up around a ritual. Frequently the myths include representatives of those supernatural forces that the rites celebrate o ...
分类:
其他好文 时间:
2019-11-06 13:33:41
阅读次数:
52
借用构造函数继承是在子类型构造函数的内部调用超类型狗在函数,通过使用apply()和call()方法 function girlFriend(){ this.girls = ['chen','wang','zhu']; } function Person(){ girlFriend.call(thi ...
分类:
编程语言 时间:
2019-11-06 12:58:54
阅读次数:
71
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button = (Button) fin... ...
分类:
移动开发 时间:
2019-11-05 13:36:01
阅读次数:
136
private Button button; private final CharSequence items[] = { "北京", "上海", "广州" }; @Override protected void onCreate(Bundle savedInstanceState) { super... ...
分类:
移动开发 时间:
2019-11-04 19:48:04
阅读次数:
306