排序:
默认
按更新时间
按访问量

synchronized同步三种使用方法

1.同步代码块 synchronized (对象){ //代码块 }上面的对象可以是任意对象,但必须为同一对象 2.同步函数 synchronized void method(){ //代码 }同步方法使用的同步对象为该方法所属类本身,即this 3.同步...

2017-12-22 16:58:46

阅读数:100

评论数:0

389. Find the Difference

Q:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more le...

2016-11-29 20:43:47

阅读数:87

评论数:0

283. Move Zeroes

Q:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For ex...

2016-11-27 13:05:42

阅读数:99

评论数:0

387. First Unique Character in a String

Q:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. 问题:给定一个字符串,找出其中第一个仅出现一次的字符,若不存...

2016-11-27 11:24:11

阅读数:107

评论数:0

258. Add Digits

Q:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is...

2016-11-27 10:18:05

阅读数:97

评论数:1

136. Single Number

Q:Given an array of integers, every element appears twice except for one. Find that single one. 问题:给定一个整数数组,其中除了一个元素仅出现一次,其他每个元素出现了两次。找到这个仅出现一次的数。 思...

2016-11-26 21:41:54

阅读数:115

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭