`
文章列表
     JDK1.5开始,Java中增加了对元数据(MetaData)的支持,也就是Annotation(注释),这种Annotation与Java程 序中的单行注释和文本注释是有一定区别,也有一定联系的。      其实,我们现在说的Annotation是代码里的特殊标记,这些标记可以在编译,类加载,运行 时被读取,并执行相应的处理。通过Annotation,程序开发人员可以在不改变原来逻辑的情况下,在源文件嵌入一些补充的信息。代码分析工具,开发工具和部署工具可通过这些补充信息进行验正或者部署。     例如:1,查看工程进度,               2,由JavaBea ...
<1>泛型参数类型限制 (1) 泛型的参数类型只能是类( class )类型,而不能是简单类型。 (2) 可以声明多个泛型参数类型,比如 <T, P,Q…> ,同时还可以嵌套泛型,例如: <List<String>> (3) 泛型 的参数 类 型可以使用 extends 语 句,例如 <T extends superclass> 。 (4) 泛型的参数类型可以使用 super 语句,例如 < T super childclass&g ...
// exceptions/Ex1.java// TIJ4 Chapter Exceptions, Exercise 1, page 452/* Create a class with a main(0 that throws an object of class Exception* inside a try block. Give the constructor for Exception a String argument.* Catch the exception inside a catch clause and print the String argument.* Add a ...
// holding/Ex1.java// TIJ4 Chapter Holding, Exercise 1, page 394/* Create a new class called Gerbil with an int gerbilNumber that's * initialized in the constructor. Give it a method called hop() that displays* which gerbil number that is, and that it's hopping. Create an ArrayList and * add Gerbil ...
// innerclasses/Outer1.java// TIJ4 Chapter Innerclasses, Exercise 1, page 347/* Write a class named Outer that contains an inner class named Innet. * Add a method to Outer that returns an object of type Inner. In main(),* create and initialize a reference to an Inner.*/ public class Outer1 { class I ...
链接地址:http://blog.csdn.net/zhaozhen1984/article/details/5911798   法1.借助StringBuilderString str="abcd123";StringBuilder sb=new StringBuilder(str);str=sb.reverse().toString;法2.利用循环String str="abcd123";char[] chs=str.toCharArray();int size=str.length();char temp;for(int i=0;i<s ...
进来学习 《Think in Java》很多Java的思想观点,深入了不少~对Access Control 的一点理解记录如下:      Access control puts boundaries within a data type for two important reasons.The first is to establish what the client programmers can and can't use.You can build your internal mechanisms into the structure without worrying that i ...
二者优缺点比较:       Hibernate的优点: Hibernate功能强大,数据库无关性好,O/R映射能力强,如果你对Hibernate相当精通,而且对Hibernate进行了适当的封装,那么你的项目整个持久层代码会相当简单,需要写的代码很少,开发 ...
首先,在src目录下,有一个文件,hibernate.cfg.xml,该文件的内容如下: ? <?xml version='1.0' encoding='UTF-8'?><!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <!-- Generated by ...
严重: Servlet.service() for servlet jsp threw exceptionjavax.servlet.jsp.JspException: Invalid argument looking up property user.name of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:959) at org.apache.struts.taglib.html.BaseFieldTag.prepareValue(Base ...
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: An exception occurred processing JSP page /form/user.jsp at line 13 10: <div style=&quo ...
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.struts.config.ModuleCon ...
    执行一个PL/SQL 块,总是报这个错:ORA-01403: 未找到数据问题,在网上搜索了半天,找到一个解决办法。 比较彻底的办法就是添加一个异常处理~     另外,在其中还应用了存储循环跳转应用,很好地复习了存储过程开发!解决问题方法如下: DECLARE   vn_sum_old NUMBER(10);  vn_sum_new NUMBER(10);  vn_count NUMBER(10) := 0;   cursor get_tcf is  SELECT account_id AS acct_id,user_idnew AS user_id,perserve01 AS ...
写一个方法,输入一个文件名和一个字符串,统计这个字符串在这个文件中出现的次数. 这是一个常见的算法提问,网上搜索结果不是很满意。自己解决了一下:   package com.xforward.ccf; import java.io.BufferedReader;import java.io.ByteArrayInput ...
<!-- 正文开始 --> public class MathTest {       public static void main(String[] args) {           System.out.println("小数点后第一位=5");           System.out.println("正数:Math.round(11.5)=" + Math.round(11.5));           System.out.println("负数:Math.round(-11.5)=" + Math.r ...
Global site tag (gtag.js) - Google Analytics