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");
    		
    	}
    	
    }
    

      

  • 相关阅读:
    ServletContext笔记
    Session笔记
    Cookie笔记
    递归实现取数组最大值
    栈结构实现队列结构
    返回栈中最小元素的两种实现O(1)
    数组实现不超过固定大小的队列(环形数组)
    双向链表实现栈和队列
    Windows Server 2008 R2 / Windows Server 2012 R2 安装 .NET Core 3.1
    Windows 7 / Windows Server 2008 R2 升级至 SP1
  • 原文地址:https://www.cnblogs.com/WINDZLY/p/11788708.html
Copyright © 2011-2022 走看看