整几个题给大家玩玩,看看“下盘功夫”怎样

不用编译器,回复你的答案。

感觉现在很多程序员老在追遂各种各样的新名词、新术语,别人把几个英语单词整一块,取出第一个字母,X除外,这年头,X牛啊,不在第一也优先取它,然后好像记住了这些缩写的意思,就是一个不会落伍的程序员,有些该学,理解思想是根,至于记不记得住那缩写,无关紧要吧,咱要做的是在自己的层面上有自己的新术语创立出来,让别人去记,大家说是不。举个例子吧,听棠.net就整一个什么什么(我对人名,地名,术语名这些记忆不敏感,上街要是跟人走,从不记路)出来(数据访问方面的),好东西来的,然后也出个缩写,这些东西的话,理解人家思路,拓展自家思路是本,看了人家的想法,自己在实战中就要运用人家的思想,用人家的东西还是自己再写,再扩展看实际情况。
反过来,有些基础的东西还是要记住,要清楚的,言归正传。

1.

 

None.gif interface IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
void F();
ExpandedBlockEnd.gif}

None.gif
class Father:IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nFather.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Children:Father
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public new void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nChildren.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif IGrandFather gf
= new Children();
InBlock.gif gf.F();
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif


 

2.

 

None.gif
None.gif
None.gif
interface IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
void F();
ExpandedBlockEnd.gif}

None.gif
class Father:IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public virtual void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nFather.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Children:Father
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public override void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nChildren.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif IGrandFather gf
= new Children();
InBlock.gif gf.F();
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}


 3.

None.gif
None.gif
interface IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
void F();
ExpandedBlockEnd.gif}

None.gif
class Father:IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public virtual void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nFather.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Children:Father
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F(string arg)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nChildren:{0}",arg);
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif IGrandFather gf
= new Children();
InBlock.gif gf.F();
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif

 

4.

None.gif
None.gif
interface IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
void F();
ExpandedBlockEnd.gif}

None.gif
abstract class Father:IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nFather.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Children:Father
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nChildren.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif IGrandFather gf
= new Children();
InBlock.gif gf.F();
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif


5.

None.gif
None.gif
interface IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
void F();
ExpandedBlockEnd.gif}

None.gif
abstract class Father:IGrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public virtual void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nFather.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Children:Father
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nChildren:{0}");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif IGrandFather gf
= new Children();
InBlock.gif gf.F();
InBlock.gif Console.ReadLine();
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif


6.

None.gif
None.gif
interface GrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
void F();
ExpandedBlockEnd.gif}

None.gif
class Father:GrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nFather.");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Children:Father,GrandFather
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public new void F()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"\nChildren");
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif GrandFather gf
= new Children();
InBlock.gif gf.F();
InBlock.gif Console.ReadLine();
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

7.readonly和const 最本质的区别在哪?

8.编写类型转换时,是别的类型转为自身用隐式转换,还是反之用隐式?

9.这段代码呢?

None.gif using System;
None.gif
None.gif
class A
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public virtual void F(string p)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(p);
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class B:A
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public void F(ref string p)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif Console.WriteLine(
"ref:"+p);
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
class Test
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
public static void Main(string[] args)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
string s = "xxxx";
InBlock.gif B b
= new B();
InBlock.gif b.F(s);
InBlock.gif b.F(
ref s);
ExpandedSubBlockEnd.gif }

ExpandedBlockEnd.gif}

None.gif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值