伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

Ten years Hello World,actually writing is life

来源:本站原创 浏览:149次 时间:2021-08-01

本文系投稿,作者:林杰。

作者寄语:十年hello world,写的是人生,每一段代码代表每一年和人生的过程。

欢迎点击阅读原文,跳转作者博客围观。

知音专栏

Javaweb练手项目源码

常用设计模式完整系列篇

技术自媒体探讨交流圈子

【强化编程功底】算法文摘

//LinJie//Ten years Hello world,actually writing is life !//Original//First yearpublic class LinJie{ public static void main(String[] args) {   //hello world   System.out.println("hello world"); }}//Second yearspublic class LinJie{ public static void main(String[] args) {   //hello world   LinJie obj = new LinJie();   obj.toString(); } /* (non-Javadoc)  * @see java.lang.Object#toString()  */ @Override public String toString() {   return "hello world"; }}//The third yearpublic class LinJie{ private static LinJie instance; public static LinJie getInstance() {   if(instance == null)     instance = new LinJie();   return instance; } /* (non-Javadoc)  * @see java.lang.Object#toString()  */ @Override public String toString() {   return "hello world"; } public static void main(String[] args) {   //hello world   LinJie obj = LinJie.getInstance();   obj.toString(); }}//Fourth yearspublic class LinJie{ private final String a; //required private final String b; //required private final String c; //optional private final String d; //optional //Builder public static class Builder{   //required   private final String a;   private final String b;   //optional   private String c;   private String d;   public Builder(String a,String b) {     this.a = a;     this.b = b;   }   public Builder c(String val)     { c = val; return this; }   public Builder d(String val)     { d = val; return this; }   public LinJie build() {     return new LinJie(this);   } } private LinJie(Builder builder) {   a = builder.a;   b = builder.b;   c = builder.c;   d = builder.d; } /* (non-Javadoc)  * @see java.lang.Object#toString()  */ @Override public String toString() {   return c+" "+d; } public static void main(String[] args) {   //hello world   LinJie obj = new LinJie.Builder("lin", "jie").       c("hello").d("world").build();   System.out.println(obj.toString()); }}//Fifth years/*<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="       http://www.springframework.org/schema/beans       http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="linjie" class="com.linjie.LinJie"></bean></beans>*/public class LinJie{ @Test public void test() {   //hello world   ApplicationContext context = new ClassPathXmlApplicationContext               ("applicationContext.xml");   LinJie obj = (LinJie) context.getBean("linjie");   obj.hello_world(); } public void hello_world() {   System.out.println("hello world������֦,���һ��"); }}//Sixth years/*<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:aop="http://www.springframework.org/schema/aop"   xmlns:context="http://www.springframework.org/schema/context"   xsi:schemaLocation="http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans.xsd       http://www.springframework.org/schema/aop       http://www.springframework.org/schema/aop/spring-aop-4.0.xsd       http://www.springframework.org/schema/context       http://www.springframework.org/schema/context/spring-context-4.0.xsd">   <!-- 扫描 --> <context:component-scan base-package="com.linjie.aop">   </context:component-scan>  </beans>*/@Component("linjie")public class LinJie{ @Test public void test() {   //hello world   ApplicationContext context = new ClassPathXmlApplicationContext               ("applicationContext.xml");   LinJie obj = (LinJie) context.getBean("linjie");   obj.hello_world(); } public void hello_world() {   System.out.println("hello world"); }}//Seventh years/*<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:aop="http://www.springframework.org/schema/aop"   xmlns:context="http://www.springframework.org/schema/context"   xsi:schemaLocation="http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans.xsd    http://www.springframework.org/schema/aop    http://www.springframework.org/schema/aop/spring-aop-4.0.xsd    http://www.springframework.org/schema/context    http://www.springframework.org/schema/context/spring-context-4.0.xsd"> <context:component-scan base-package="com.linjie.aop">   </context:component-scan>   <aop:aspectj-autoproxy></aop:aspectj-autoproxy>  </beans>*//*@Component("arithmetic")public class Arithmetic { public void hello_world() {}}*/@Aspect@Component("linjie")public class LinJie{ @Test public void test() {   //hello world   ApplicationContext context = new ClassPathXmlApplicationContext               ("applicationContext.xml");   LinJie obj = (LinJie) context.getBean("linjie");   obj.hello_world(); } @Before("execution(* com.linjie.aop.Arithmetic.*(..))") public void Before_Loggin() {   System.out.println("hello world"); }}//Eighth years fail//Ninth years fail//Tenth yearspublic class LinJie { public static void main(String[] args) {   String grow       = "hello world";   String grow_up    = "hello world";   String grow_up_up = "hello world";   if(grow.equals(grow_up) && grow.equals(grow_up_up))     System.out.println(grow); }}

  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net