public class Price{
final static Price INSTANCE = new Price(2.8);
static double initPrice = 20;
double currentPrice; public Price(double discount){
currentPrice = initPrice - discount;
}
}
public class Main {

    public static void main(String[] args) {

        System.out.println(Price.INSTANCE.currentPrice);

        Price p = new Price(2.8);
System.out.println(p.currentPrice);
}
}

最新文章

  1. float4与half4数据类型
  2. 程序员能力矩阵 Programmer Competency Matrix
  3. addEventListener、attachEvent、cancelBubble兼容性随笔
  4. [转]B树、B-树、B+树、B*树
  5. rabbitmq学习笔记2 基本概念
  6. 李洪强iOS学习交流群-iOS大神群
  7. Android平台程序崩溃的类型及原因列举
  8. java 产生随机数
  9. (转)UIWebView与JavaScript的那些事儿
  10. Android SD卡创建文件和文件夹失败
  11. 通过VMware安装Linux操作系统
  12. Amazon Alexa登录授权(Android)
  13. Prim最小生成树板子
  14. MySQL之表相关操作
  15. DELPHI中MDI子窗口的关闭和打开
  16. 推荐一个实用的 .gitignore 文件
  17. phpbbchina恢复上线
  18. Nginx深度优化
  19. rabbitmq日志记录进出的每条消息
  20. 分割回文串 II · Palindrome Partitioning II

热门文章

  1. RadGrid SelectedIndexChanged 事件没反应的解决方法
  2. tttt
  3. 移动web开发中遇到的一些问题收纳
  4. AFNetworiking与ASIHttpRequest对比
  5. 解决Windows 7/win8 使用VMware虚拟机的NAT 不能上网
  6. a:hover和a:visited书写顺序的重要性
  7. android WebView, WebChromeClient和WebViewClient加载网页基本用法
  8. hdr(host), hdr_beg(host) , path_beg
  9. unix c 08
  10. hdu3870-Catch the Theves(平面图最小割)