这章中我们了解到了访问修饰符的概念,对public、default、protected、private有了清晰的认识,希望在以后的操作中学会灵活运用。 private为我们提供了封装的概念,并提供public方法供我们访问和修改方法和属性,这样不但可以限制某些属性的修改访问,还可以对内层的属性方法进 ...
分类:
其他好文 时间:
2016-05-29 23:15:05
阅读次数:
169
package lianxi; import java.util.*; public class JhSet { public static void main(String[] args) { Set<String> ss=new HashSet<>(); ss.add("A"); ss.add( ...
分类:
其他好文 时间:
2016-05-29 22:44:56
阅读次数:
690
1.把excel文件读到DataTable ///<summary> ///根据excel路径和sheet名称,返回excel的DataTable ///</summary> public static DataTable GetExcelDataTable(string path, string ...
分类:
数据库 时间:
2016-05-29 21:18:46
阅读次数:
203
C#里的Delegate据说相当于C++函数指针。如上例首先,用语法delegate 定义个一个delegate(和函数签名完全一样,只是多了个关键字delegate),相当于自定义了一个类型。然后可以声明一个自定义委托的一个实例(有点类实例化对象的意思),如代码里的public EventHand ...
分类:
其他好文 时间:
2016-05-29 20:01:24
阅读次数:
194
运行,出现以下错误:Property 'username' has no setter method in class 'class cn.hfy.User' 刚出现,很疑惑。随即反应过来, User1并不是public的。 The class must be public, and provide ...
分类:
其他好文 时间:
2016-05-29 19:51:39
阅读次数:
121
Activityaidl接口文件package com.bqt.aidlservice; interface IBinderInterface { /* 更改文件后缀为【.aidl】去掉public等所有修饰符。 更改后,会在gen目录下生成一个同名的.java文件,此java文件中有一个名为【St... ...
分类:
系统相关 时间:
2016-05-29 19:40:59
阅读次数:
240
创建一个bird类 public class Bird implements Flyable{ @Override public void Fly() { // TODO Auto-generated method stub System.out.println(""); }} 创建一个接口带有飞的 ...
分类:
其他好文 时间:
2016-05-29 18:26:04
阅读次数:
146
首先先创建一个类 public class Father { private Daughter daughter ;//拥有女儿属性 public Daughter getDaughter() { return daughter; } public void setDaughter(Daughter ...
分类:
其他好文 时间:
2016-05-29 18:22:07
阅读次数:
132
public class FormatTest { /*public static int maxStringLength; public static double minSize;*/ private static int maxStringLength; private static doub ...
分类:
其他好文 时间:
2016-05-29 18:17:13
阅读次数:
164
package ForType; public class ForType { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub //申明for。计算机看到 ...
分类:
其他好文 时间:
2016-05-29 18:12:29
阅读次数:
151