zoukankan
html css js c++ java
struct也有方法成员
using
System;
using
System.Collections.Generic;
using
System.Text;
namespace
App1
{
struct
Point
{
public
Int32 x, y;
public
void
Change(Int32 x, Int32 y)
{
this
.x
=
x;
this
.y
=
y;
}
//
public override string ToString()
//
{
//
//
return base.ToString();
//
return string.Format("{0},{1}", x, y);
//
//
return string.Format("{0},{1},{2}", x, y, x);
//
}
}
class
Program
{
static
void
Main(
string
[] args)
{
Point p
=
new
Point();
p.x
=
p.y
=
1
;
Console.WriteLine(p);
//
调用p的ToString()方法,若不override---ToString()则输出"App1.Point"
/**/
///////////////////////////
Console.Read();
}
}
}
查看全文
相关阅读:
《JavaScript》forEach()和map()
《JavaScript》split和join
09慕课网《进击Node.js基础(一)》HTTP-get/request
08慕课网《进击Node.js基础(一)》事件events
07慕课网《进击Node.js基础(一)》HTTP小爬虫
06慕课网《进击Node.js基础(一)》作用域和上下文
05慕课网《进击Node.js基础(一)》HTTP概念进阶(同步/异步)
前端每周学习分享--第4期
前端每周学习分享--第3期
前端每周学习分享--第2期
原文地址:https://www.cnblogs.com/shuang/p/1007165.html
最新文章
JSF的分析
Applets的分析
Ajax的分析
Log Filter分析
ASYNC分析
session的部分理解
XML的介绍
基础加强_反射
网络编程【Socket网络编程】
多线程【Thread、线程创建】
热门文章
IO【转换流,打印流,序列化】
IO【字节流、高效流】
IO(File 递归)
集合【Map、可变参数、Collections】
集合【LinkedList、HashSet、Collection集合体系】
集合【迭代器、增强for、泛型】
常用API【Date、DateFormat、Calendar、Math、System、包装类、正则表达式】
《JavaScript》字符转义
connect by prior id= pid start with id='1' 树结构查询
《JavaScript》数组Array
Copyright © 2011-2022 走看看