由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: question about interface.(也许是答案)
相关主题
用java画直线的问题What specific services does a container provide f
override/overload/overwrite in JavaRe: Can create a Interface object, why?
一个土土的问题Re: 问一个关于Java Native Interface的问题
Re: print problem, GUI guru please come inRe: Java Tip: Constant
how to change the input mode?can applet implements runnable?
extending generic class , but not mentioning its parameterized type?[转载] help please on Java
jdbc connection timeout ?Help! interface Scanner with Pdf file
How does a client find and connect to a specificJDBC or SQL-C?
相关话题的讨论汇总
话题: interface话题: public话题: class话题: 里面话题: variable
进入Java版参与讨论
1 (共1页)
m**r
发帖数: 13
1
所有interface的varialble应该是public final static
(我记得Thbinking in Java里面应该是这么说的,
而且在下面的例子里面我可以call A.i)
如果一个class implement了一个interface,
interface里面的variable是可以overwrite的,
就象你extends一个super class,可以overwrite super class里面的variable一样.
如果你直接implement那个interface,那么interface里面的variable你就在也没
机会看到了.
下面是个例子,结果是
1
0
public class Test extends B{
private int i = 1;

public int getI() { return i; }

public int getAI() { return super.i; }

public static void m
1 (共1页)
进入Java版参与讨论
相关主题
JDBC or SQL-C?how to change the input mode?
simple question: What is API stand for?extending generic class , but not mentioning its parameterized type?
Why Java needs clone interface?jdbc connection timeout ?
help: interface and classHow does a client find and connect to a specific
用java画直线的问题What specific services does a container provide f
override/overload/overwrite in JavaRe: Can create a Interface object, why?
一个土土的问题Re: 问一个关于Java Native Interface的问题
Re: print problem, GUI guru please come inRe: Java Tip: Constant
相关话题的讨论汇总
话题: interface话题: public话题: class话题: 里面话题: variable