自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 资源 (3)
  • 收藏
  • 关注

转载 JavaBean入门

不会编写JavaBean就不是一个Java开发人员。 那么,何谓JavaBean呢? JavaBean是符合某种规范的Java组件,也就是Java类。 它必须满足如下规范: 1)必须有一个零参数的默认构造函数 2)必须有get和set方法,类的字段必须通过get和set    方法来访问。    (get方法无参,set方法有参) 我们下

2016-07-30 21:40:27 254

转载 java类加载器

顾名思义,类加载器(class loader)用来加载 Java 类到 Java 虚拟机中。一般来说,Java 虚拟机使用 Java 类的方式如下:Java 源程序(.java 文件)在经过 Java 编译器编译之后就被转换成 Java 字节代码(.class 文件)。类加载器负责读取 Java 字节代码,并转换成 java.lang.Class类的一个实例。每个这样的实例用来表示一个 Java

2016-07-30 20:58:40 304

转载 深入理解Java:注解(Annotation)--注解处理器

如果没有用来读取注解的方法和工作,那么注解也就不会比注释更有用处了。使用注解的过程中,很重要的一部分就是创建于使用注解处理器。Java SE5扩展了反射机制的API,以帮助程序员快速的构造自定义注解处理器。注解处理器类库(java.lang.reflect.AnnotatedElement):  Java使用Annotation接口来代表程序元素前面的注解,该接口是所有Annotati

2016-07-28 17:05:56 246

原创 对java Field中的set()方法以及Modifier的一些思考

只前转载了一篇文章《JAVA反射修改常量,以及其局限》,受益匪浅,在这里再次感谢原作者。在看完文章后,我又试着写了一个测试程序,在期间也遇到了一些问题,写在这里,供大家参考。程序入下:import java.lang.reflect.Field;class My{ private static final int value= 1; private static

2016-07-27 16:18:56 5404

转载 JAVA反射修改常量,以及其局限

原文地址http://blog.csdn.net/barryhappy/article/details/24442953/问题,以及一个解决方案今天公司的JAVA项目碰到一个问题:在生成xls文件的时候,如果数据较多,会出现ArrayIndexOutOfBoundsException。Google发现是项中所用的jxl包(开源库,用以处理xls文件)的一个BUG。也找到了一个解

2016-07-27 15:15:51 1012 1

原创 华为Oj 坐标移动

题目描述开发一个坐标计算工具, A表示向左移动,D表示向右移动,W表示向上移动,S表示向下移动。从(0,0)点开始移动,从输入字符串里面读取一些坐标,并将最终输入结果输出到输出文件里面。 输入: 合法坐标为A(或者D或者W或者S) + 数字(两位以内) 坐标之间以;分隔。 非法坐标点需要进行丢弃。如AA10;  A1A; 

2016-07-16 15:55:34 365

原创 visio 2010 激活方法

之前激活visio一直用的是激活码,但是这次用激活码却怎么也成功不了,很郁闷。然后网上也下了一些工具,但我发现不是所有号称可以激活visio的工具都可以的这里就介绍下我使用的工具吧:  Microsoft Toolkit_V2.3.2运行后选择Product Keys->Edition->你装的版本(比如visio premium);Activation->Tool选择AutoKMS-

2016-07-16 13:37:06 5313 1

原创 java中setSize(),setLocation()和setBounds()的关系

之前也一直没有太在意这三个函数之间的关系,今天遇到了,就特地查了下:setSize(int width, int height):其实就是定义控件的大小,有两个参数,分别对应宽度和高度;setLocation(int x, int y):将组件移到新位置,用x 和 y 参数来指定新位置的左上角setBounds(int x, int y, int width, int he

2016-07-12 20:56:55 39781

原创 句子逆序

将一个英文语句以单词为单位逆序排放。例如“I am a boy”,逆序排放后为“boy a am I”所有单词之间用一个空格隔开,语句中除了英文字母外,不再包含其他字符输入描述:将一个英文语句以单词为单位逆序排放。输出描述:得到逆序的句子输入例子:I am a boy输出例子:boy a am Iimport java.ut

2016-07-10 21:19:16 1300

转载 深入理解HTTP协议

1. 基础概念篇1.1 介绍  HTTP是Hyper Text Transfer Protocol(超文本传输协议)的缩写。它的发展是万维网协会(World Wide Web Consortium)和Internet工作小组IETF(Internet Engineering Task Force)合作的结果,(他们)最终发布了一系列的RFC,RFC 1945定义了HTTP/1.0版本。其中

2016-07-07 10:19:29 240

原创 leetcode:Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2016-07-06 15:28:45 212

原创 leetcode:Divide Two Integers

Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.需要注意的是负的最大值为-2147483648,正的最大值为2147483647;因此需要将变量设置为long类型最开始我的想法是既然不能除,那就每次都减去

2016-07-06 13:41:42 193

原创 MFC连接office 2010的access数据库

在用ado连接数据库的时候,网上许多的资料都是对应早期版本的access,所以数据库链接代码大多是CString strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";strConnection += "test.mdb";但是现在我们多使用了比较新的office软件了,比如office 20

2016-07-05 22:55:12 1312

原创 button控件圆角矩形的自绘方法

1、在DrawItem中直接自己自绘//////////////画圆角矩形/////HRGN h_rgn = CreateRoundRectRgn(0,0,rect.right,rect.bottom,rect.Width()/2,rect.Height());SetWindowRgn(h_rgn,TRUE);// 圆角矩形填充颜色CBrush brush;brush.Cr

2016-07-05 22:40:34 4956

原创 leetcode:Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.开始没考虑k比链表长度大的情况,其实到现在我们不清楚为啥要考虑这种

2016-07-05 22:17:23 189

原创 leetcode:Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i,

2016-07-05 19:41:33 180

原创 leetcode: Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y

2016-07-05 19:38:12 200

转载 Java中只有按值传递,没有按引用传递!

今天,我在一本面试书上看到了关于java的一个参数传递的问题:写道java中对象作为参数传递给一个方法,到底是值传递,还是引用传递? 我毫无疑问的回答:“引用传递!”,并且还觉得自己对java的这一特性很是熟悉!结果发现,我错了!答案是:值传递!Java中只有按值传递,没有按引用传递! 回家后我就迫不及待地查询了这个问题,觉得自己对j

2016-07-05 17:03:37 177

原创 leetcode:Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2016-07-04 15:36:03 179

原创 leetcode:Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A partially f

2016-07-03 20:14:33 175

原创 Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit

2016-07-03 17:19:27 162

原创 leetcode: Pascal's Triangle

Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]public class Solut

2016-07-03 17:15:29 150

原创 leetcode: Pascal's Triangle II

Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1]public class Solution { public List getRow(int rowIndex) { int n=0;

2016-07-03 17:05:58 163

转载 浅谈:request,session,application

request,session,application,三者比较作用域::request 各自对应的接口request对象 对应的接口 :javax.servlet.ServletRequest 其子接口:javax.servlet.http.HttpServletRequestsession对象 对应的接口

2016-07-02 18:03:43 218

原创 关于getDeclaredMethods与getMethods的的区别

1、getMethods返回一个包含某些 Method 对象的数组,这些对象反映此 Class 对象所表示的类或接口的公共 member 方法。2、getDeclaredMethods返回 Method 对象的一个数组,这些对象反映此 Class 对象表示的类或接口声明的所有方法,包括公共、保护、默认(包)访问和私有方法,但不包括继承的方法。也就是说getDeclaredMethods能拿

2016-06-30 17:30:59 9517

转载 浅谈HTTP中Get与Post的区别

浅谈HTTP中Get与Post的区别      本文转自http://write.blog.csdn.net/postedit  Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE。URL全称是资源描述符,我们可以这样认为:一个URL地址,它用于描述一个网络上的资源,而HTTP中的GET,POST,PUT,DELETE就对应着

2016-06-27 10:34:30 176

转载 使用注解标注Servlet

本文转自http://www.cnblogs.com/xdp-gacl/p/4222902.html一、Servlet3.0介绍  Servlet3.0是Java EE6规范的一部分,Servlet3.0提供了注解(annotation),使得不再需要在web.xml文件中进行Servlet的部署描述,简化开发流程。二、开发Servlet3.0程序的所需要的环境

2016-06-25 21:47:02 467

原创 MyEclipse15 中tomcat的部署

一、在Tomcat的server.xml配置文件中部署1、在Tomcat下,找到conf文件下的server.xml,打开。2、之前(应该是倒数第四行)加上如下代码path:表示在浏览器中输入http://localhost:8080/虚拟目录名;docBase:表示你的程序包的物理绝对路径,默认的绝对路径是 %tomcat_home%/webappsreloadabl

2016-06-25 16:46:40 1179

原创 leetcode :Implement strStr()

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串。如果是,则该函数返回str2在str1中首次出现

2016-06-22 22:11:20 185

原创 leetcode:Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "

2016-06-22 17:09:18 151

原创 leetcode:Longest Palindromic Substring java

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.开始我直接用了下面的蛮力解法

2016-06-22 16:57:10 156

原创 leetcode:Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4

2016-06-18 22:08:16 165

原创 leetcode:same tree的 java实现 (两行)

Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value./** * Definit

2016-06-18 18:03:27 241

原创 Binary Tree Level Order Traversal的java实现

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 2

2016-06-17 22:44:24 270

原创 带权值的图的邻接表的java代码实现

话不多说,直接放代码package graph;import java.util.ArrayList;public class AdjGraph{ private ArrayList vertexList=new ArrayList();//保存顶点信息 private int numOfEdges; public void addNode(String data) {

2016-05-24 12:55:35 2032

原创 模板实参推断与函数指针的一些事

最近学了模板实参推断与函数指针的一些知识,觉得有些东西可以写下来与大家分享。这是我的第一篇博客,不足之处请大家指针O(∩_∩)O首先上代码:#include#include using namespace std;template T add(const T &v1,const T &v2){ return (v1+v2);}int main(){ int (

2015-11-10 09:44:51 360

贪吃蛇小程序c语言版

简单的贪吃蛇程序,win32控制台,c语言

2015-10-23

四则混合运算计算器

用vs2008做的一个简单的简答的四则混合运算,支持括号,加减乘除以及指数运算

2015-10-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除