码迷,mamicode.com
首页 >  
搜索关键字:maybe not public    ( 83099个结果
Map中按value值排序
大家都知道,在java中的集合Map中按键值key排序比较简单,只需引用集合TreeMap即可,可是怎样实现按value值排序呢?下面我们来测试一下: public class TestHashMap { public static void main(String[] args) { Map map = new HashMap(); map.put("zhangsan", 1); ...
分类:其他好文   时间:2014-05-15 02:37:34    阅读次数:263
Cocos2d-x 系列三之C++语言
1.面向对象直接定义类class People {public: void sayHello() { printf("hello c oop \n"); }}; People * p = new People(); p->sayHello();使用头文件定义Ml...
分类:编程语言   时间:2014-05-15 02:23:54    阅读次数:440
strategy(策略模式)
DiscountStrategy.javapackage edu.strategy;abstract public class DiscountStrategy{ abstract public double calculateDiscount();}FlatRateStrategy.java...
分类:其他好文   时间:2014-05-15 02:23:17    阅读次数:320
[leetcode]_Maximum Depth of Binary Tree
第三道树的题目,我还是不会,我擦,怎么递归算法还是不能很好理解。看来还得好好研究下递归算法。题目:求一棵树的最大深度。思路:递归地求取左子树最大深度 和 右子树最大深度,返回较大值即为 整棵树的 最大深度。代码:public int maxDepth(TreeNode root) { ...
分类:其他好文   时间:2014-05-14 23:07:14    阅读次数:373
c++类中对数据成员进行初始化和赋值的区别
在c++中定义一个类 ,对于构造函数 我们经常是这么写的: class test { public: test(int n_x , int n_y) { x = n_x; y = n_y; } private: int x , y; }; 这中写法虽然是合法的但比较草率 在构造函数 test(int n_x , i...
分类:编程语言   时间:2014-05-14 20:13:39    阅读次数:322
parent,son深刻理解this,super关键字
核心点: super关键字,表示调用的是父类对象。 this关键字,表示调用的是当前运行类对象。 那么如果在父类中,使用了关键字,this,此时的this指的是什么呢? 看下面的例子,再加深理解核心店的第二句话就ok了。 parent类: package com.ghsy.thissuper; public class Parent { public void init(){ ...
分类:其他好文   时间:2014-05-14 20:04:29    阅读次数:217
并发编程实践五:ReentrantLock
ReentrantLock是一个可重入的互斥锁,实现了接口Lock,和synchronized相比,它们提供了相同的功能,但ReentrantLock使用更灵活,功能更强大,也更复杂。这篇文章将为你介绍ReentrantLock,以及它的实现机制。 ReentrantLock介绍 通常,ReentrantLock按下面的方式使用: public class ReentrantLockTest...
分类:其他好文   时间:2014-05-14 20:02:26    阅读次数:397
unity发布exe全屏方法
首先 将该代码挂在NGUI的UIroot上 using UnityEngine; using System.Collections; public class example : MonoBehaviour { public void Awake() { Screen.SetResolution(1024, 768, true);//自己想要的分辨率,比如1024*768,true表示全...
分类:其他好文   时间:2014-05-14 19:24:25    阅读次数:404
spring Quartz基于配置文件和注解的实现
这里只是做简单的记录如何实现。 一、基于配置文件的实现        ①编写需要调度的类 package com.study; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; //@Component public cla...
分类:编程语言   时间:2014-05-14 19:21:22    阅读次数:279
Java Swing界面编程(1)
写多了jsp,对于页面式的系统已经写烦了,本人也开始着手于java swing的学习,作为菜鸟,仅想用博客记录下我的swing学习的历程。话不多说,首先开始我的第一个窗口化程序。 以下给出源代码: package com.beyole.util; import java.awt.Color; import javax.swing.JFrame; public class test1 { ...
分类:编程语言   时间:2014-05-14 19:20:19    阅读次数:323
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!