// 工厂模式 function Person(name,age){ var o = new Object(); o.name=name; o.age=age; o.sayName=function(){ alert(o.name) } return o } var o1=Person('lele' ...
分类:
编程语言 时间:
2020-01-16 12:41:13
阅读次数:
82
0长数组介绍:也叫柔性数组 用途:为了满足需要变长度的结构体 用法:在一个结构体的最后,申明一个长度为0的数组,就可以实现这个结构体长度的可变,如: typedef struct _Student { int Age; int Length; char Info[0];//0长数组 }Student ...
分类:
编程语言 时间:
2020-01-16 12:37:10
阅读次数:
104
问题: 单从字面理解,我们很容易得出列名称不存在的结论, 但是,很多时候并不是列名出错造成的,而是由于拼凑sql语句时对字符类型数据没有用引号引起来造成的。 例子: 例如: String sql="select age from user where name="+xxx+"; 设置name的值为c ...
分类:
其他好文 时间:
2020-01-16 01:20:02
阅读次数:
98
先看一段类代码的定义: 类的头文件 #pragma once #include<iostream> using namespace std; class mycoach { public: char name[30]; int age; char expertise[60]; char foods[ ...
分类:
编程语言 时间:
2020-01-14 09:45:07
阅读次数:
144
New York is 3 hours ahead of California, but it does not make California slow. 纽约时间比加州时间早三个小时,但加州时间并没有变慢。 Someone graduated at the age of 22, but wait ...
分类:
其他好文 时间:
2020-01-14 09:22:14
阅读次数:
76
1):对象 List<User> 转 Map<String,Object> 案例如下: public class User { private Integer id; private String age; User(Integer id, String age) { this.id = id; t ...
分类:
其他好文 时间:
2020-01-13 18:09:40
阅读次数:
72
public class Student { private int no; private String name; private int age; public Student(int no, String name, int age) { // 带参数的构造方法 this.name=name ...
分类:
编程语言 时间:
2020-01-13 16:08:30
阅读次数:
142
一、面向对象的几个特点 面向对象也称为类,拥有下面几个特点 1、封装特性:利用类的__init__(self)构造方法封装对象 构造方法:__init__(self):在生成对象的时候会自动调用 例子: class person(): def __init__(self,name,age,sex): ...
分类:
编程语言 时间:
2020-01-12 18:08:27
阅读次数:
79
一、Cookie 1. HTTP服务器是无状态的,不会记录上下文 2. Cookie是服务器生成,放在客户端存储 3. 用于识别用户 4. Cookie的安全机制:Max-Age/Domain/HttpOnly/Secure/Path等属性 5. Java中使用Cookie类 二、Session 1 ...
分类:
其他好文 时间:
2020-01-12 13:04:28
阅读次数:
85
类的初始化 类的三大特性有类实例,属性和类方法 class Person: pass 1.类属性的添加,可以直接在类下面写入,也可以在类外面写入 class Person: # 直接在类下面添加 age = 23 height = "180cm" hobby = "code" # 在类外面添加 类名 ...
分类:
其他好文 时间:
2020-01-12 11:34:19
阅读次数:
91