SQL静态
静态
1、普通成员
普通成员都是属于对象的
用对象调用
2、静态成员
静态成员是属于类的
用类名调用
class FenBi
{
public int length;//普通成员
public string color;//
}
static 静态关键字
静态方法里面不能包含普通成员
普通方法里面可以包含静态成员
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ZuHe zh = new ZuHe(); //zh.name="张三"; //调用普通成员
//ZuHe.zname = "五月天"; //调用静态成员
ZuHe.Sing();
1.为了简便
连接数据库的时候,造连接对象类,使用静态属性直接返回连接对象。
2.两个类之间传递信息
3.不允许创建对象的类(对创建对象的个数有限制)
Console.WriteLine(zh.Run());
Console.ReadLine();
}
}
class ZuHe
{
public string name="李四"; //普通成员,组合里面某个人的名字 public static string zname = "李四"; //静态成员,组合名字 public static string Sing() //静态方法
{
return "正在唱歌";
} public string Run() //普通成员
{
return zname+"正在奔跑";
}
} }
SQL静态的更多相关文章
- hive SQL 静态分区和 动态分区
Hive 分区介绍: hive中简单介绍分区表(partition table),含动态分区(dynamic partition)与静态分区(static partition) hive中创建分区表没 ...
- 匿名PL/SQL
立此存照 匿名PL/SQL 语法结构:PL/SQL是一种块结构的语言,组成PL/SQL程序的单元是逻辑块,一个PL/SQL程序包含了一个或多个逻辑块,每一块都可以划分3个部分.变量在使用前必须声明,P ...
- 09 高效的PL/SQL程序设计
程序包 Package 断开了依赖链 实验依赖关系: <1> 首先不使用包 -- 创建表 CREATE table t (x int); -- 创建视图 create view v as ...
- 动态SQL语句:定义(一)
文章系列 动态SQL语句:定义(一) 静态SQL与动态SQL 静态SQL:程序运行前,具有固定的形式和结构的SQL. 动态SQL:程序运行时,能够动态改变形式或结构的SQL. 一些思考和想法 在实际的 ...
- iBatis2 SqlMap中经常使用sql语句
本来我也不喜欢iBatis,那是由于我当时还不怎么会用它,如今我想说,iBatis是个好东西,不信你试试看.以下是我在项目实践中对iBatis的一个小总结.希望帮助众多在疲于iBatis编码而无暇思考 ...
- 数据库系统学习(十)-嵌入式SQL语言之动态SQL
第十讲 嵌入式SQL语言之动态SQL 静态SQL 区别变量和属性:高级语言向嵌入式SQL传递变量的方法 动态SQL 动态构造SQL语句是应用程序员必须掌握的重要手段 SQL语句的动态构造示例 根据界面 ...
- PL/SQL存储过程
一.概述 过程和函数统称为PL/SQL子程序,他们是被命名的PL/SQL块,均存储于数据库中. 并通过输入.输出和输入输出参数与其调用者交换信息.唯一区别是函数总向调用者返回数据. 二.存储过程详解 ...
- MyBatis动态SQL和缓存
1. 什么是动态SQL 静态SQL:静态SQL语句在程序运行前SQL语句必须是确定的,SQL语句中涉及的表的字段名必须是存在的,静态SQL的编译是在程序运行前的. 动态SQL:动态SQL语句是在程序运 ...
- cursor 与refcursor及sys_refcursor的区别 (转载)
楼主标明是转载的,我只把我转载的地址发上来 http://www.cnblogs.com/honliv/archive/2011/07/21/2112639.html 显式是相对与隐式cursor而言 ...
随机推荐
- What's Assembly - CSharp - Editor - first pass.dll? Best How to Fix Assembly - CSharp - Editor - first pass.dll Error Guide
If you've found yourself here, I'm guessing that you're getting Assembly - CSharp - Editor - first p ...
- 深入了解Windows句柄到底是什么
深入了解Windows句柄到底是什么 http://blog.csdn.net/wenzhou1219/article/details/17659485 总是有新入门的Windows程序员问我Wind ...
- membership 在web.config中配置信息
<?xml version="1.0" encoding="utf-8"?><configuration> <configSect ...
- 高德地图API应用
高德地图官网:http://api.amap.com/javascript/ 输入关键字,搜索地址功能的网页: 1.引用远程Map Api(js)网址形式(注册后获取) 2.定义个<div> ...
- 移动web开发--meta 之 viewport
常用的 viewport meta 如下: 1 <meta name="viewport" content="width=device-width,initial- ...
- I方法 thinkphp
function I($name,$default=null,$filter=null,$datas=null) { static $_PUT = null; $default_filter='htm ...
- jade编译乱码问题
加上: meta(http-equiv="Content-Type",content="text/html; charset=utf-8")
- [LeetCode]题解(python):086 - Partition List
题目来源 https://leetcode.com/problems/partition-list/ Given a linked list and a value x, partition it s ...
- Miscellaneous--Tech
1. Questions: 1)EF.2)MVC/MVP/MVVM.3)page lifecyle. preInit,Init,InitCompleted,preLoad,Load,LoadCompl ...
- iOS prototype Cells
在storyboard这方面用到的很少,cell也没有用到.上个周五,汤老师快下班的时候说:你看,我的界面已经搭建完成了.而我这边还没有头绪.现在想把需求模拟一下,结果流程没有弄完,自己在这搭起界面来 ...