zoukankan      html  css  js  c++  java
  • java中System方法

    package test;
    
    
    import java.util.*;
    import java.util.concurrent.SynchronousQueue;
    import java.util.concurrent.locks.Lock;
    
    import javax.print.attribute.IntegerSyntax;
    
    import org.omg.CosNaming.NamingContextExtPackage.AddressHelper;
    
    import privateclass.*;
    import java.io.*;
    
    public class Main {
    
    	private static final String space_operator = " ";
    	public static void main(String[] args) throws Exception {
    
    		Scanner scanner = new Scanner(new BufferedInputStream(System.in));
    		//PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    		
    		TreeMap<Character,Integer> hashMap = new TreeMap<Character,Integer>();
    		
    		long time1 = System.currentTimeMillis();
    		String string = "dsddd --gdfg  dbx sdz";
    		for (int i = 0; i < string.length(); i++) {
    			Integer valueInteger = hashMap.get(string.charAt(i));
    			if(!Character.isAlphabetic(string.charAt(i)))continue;
    			
    			int count = 1;
    			if(valueInteger != null)
    			{
    				count = valueInteger + 1;
    			}
    			hashMap.put(string.charAt(i), count);
    
    		}
    		
    	
    		
    		System.out.println(hashMap);
    		
    		//获取时间   时间是距离1970年的时间
    		long time2 = System.currentTimeMillis();
    		
    		
    		System.out.println(time2 - time1);
    		
    		/*
    		 * 获取系统信息
    		 */
    		/*
    		Properties mes = System.getProperties();
    		for(Object name : mes.keySet())
    		{
    			System.out.println(name + "::" + mes.getProperty((String) name));
    		}
    		*/
    		
    		/*
    		 * 拿到系统所用的换行符号直接换行,针对不一样的系统
    		 */
    		final String LINE_SEPARATOR = System.getProperty("line.separator");
    		System.out.println("hello" + LINE_SEPARATOR + "word");
    		
    		
    		/*
    		 * 可以自己设置系统属性
    		 */
    		System.setProperty("myclass", "tiantian");
    		
    	}
    	
    }
    

      

  • 相关阅读:
    SharePoint
    北京的雨
    SharePoint2003安装问题解答
    SharePoint安装时“Service Unavailable”的解决办法
    SharePoint安装程序常见问题解答和故障排查指南,做个参考:)
    银弹的看法
    vue组件注册方式
    vue中template和render的区别
    前端需要注意的SEO
    公众号中H5页面分享给好友或朋友圈自定义图片或文字
  • 原文地址:https://www.cnblogs.com/WINDZLY/p/11788708.html
Copyright © 2011-2022 走看看