相信对于继承和多态的概念性我就不在怎么解释啦!不管你是.Net还是Java面向对象编程都是比不缺少一堂课~~Net如此Java亦也有同样的思想成分包含其中. 继承,多态,封装是Java面向对象的3大特征. 继承 如果用.Net写一个A类继承B类的话,写法会是大致如下: Public Class A : B{ ....... } Java的话却要通过extends关键字在声明类的时候指定其父类(基类),所以上面的.Net写法要转换成Java的话应该是下面的样子: Public clas A ext
1.Motivation | 起因 A requirement from the product department requires download image from AWS S3 bucket, for achieving this requirement, I should set the image content MIME header as Content-Disposition:Attachment. 产品部门有一项需求是从S3上下载图片,为了完成这一需求,需要把图片的MI
1.日志工具类L.java package com.zhy.utils; import android.util.Log; /** * Log统一管理类 * * * */ public class L { private L() { /* cannot be instantiated */ throw new UnsupportedOperationException("cannot be instantiated"); } public static boolean isDebug
MD5加密 import android.annotation.SuppressLint; import java.security.MessageDigest; public class MD5 { @SuppressLint("DefaultLocale") public static String hex(byte[] array) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.lengt
import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; //跟App相关的辅助类 public class AppUtils { private AppUtils() { /* cannot be in
一.日志工具类 Log.java public class L { private L() { /* 不可被实例化 */ throw new UnsupportedOperationException("Cannot be instantiated!"); } // 是否需要打印bug,可以在application的onCreate函数里面初始化 public static boolean isDebug = true; private static final String TAG
Android-JSONUtil工具类 常用的Json工具类,包含Json转换成实体.实体转json字符串.list集合转换成json.数组转换成json public class JSONUtil { private static final String TAG = JSONUtil.class.getSimpleName(); private JSONUtil(){} private static Gson gson = new Gson(); /** * 传入一个头部,获取头部管控中的所