当前位置:首页 > 图灵资讯 > 技术篇> Java save Java saveformat
Java save Java saveformat
发布时间:2023-05-18 09:21:39
添加codeformat模板的Eclipse(见附件)。
Windows--Preference--Java--Code Style--Format, import附件中的模板。
--Java--Editor--Save Actions, 勾选Format source code,自动format代码将在编辑保存时进行。非常方便。
格式如下:
/** * A sample source file for the code formatter preview */package mypackage;import java.util.LinkedList;public class MyIntStack{ private final LinkedList fStack; public MyIntStack() { fStack = new LinkedList(); } public int pop() { return ((Integer)fStack.removeFirst()).intValue(); } public void push(int elem) { fStack.addFirst(new Integer(elem)); } public boolean isEmpty() { return fStack.isEmpty(); }}
本文是转载内容,我们尊重原作者对文章的权利。如有内容错误或侵权行为,请联系我们更正或删除文章。
ps 图灵课堂老师从近一百套最新一线互联网公司面试题中精选而出,涵盖Java架构面试 所有技术栈,包括JVM,Mysql,并发,Spring,Redis,MQ,Zookeeper,Netty, Dubbo,Spring Boot,Spring Cloud,数据结构与算法,设计模式等相关技术领域的大 厂面试题及详解。 详情咨询客服获取全套面经试题。