Показаны сообщения с ярлыком Java. Показать все сообщения
Показаны сообщения с ярлыком Java. Показать все сообщения
Как прокомментировать Java-класс
/** * Allocates a new <code>String</code> that contains characters from * a subarray of the character array argument. The <code>offset</code> * argument is the index of the first character of the subarray and * the <code>count</code> argument specifies the length of the * subarray. The contents of the subarray are copied; subsequent * modification of the character array does not affect the newly * created string. * * @param value array that is the source of characters. * @param offset the initial offset. * @param count the length. * @exception IndexOutOfBoundsException if the <code>offset</code> * and <code>count</code> arguments index characters outside * the bounds of the <code>value</code> array. */ public String(char value[], int offset, int count) { if (offset < 0) { throw new StringIndexOutOfBoundsException(offset); } if (count < 0) { throw new StringIndexOutOfBoundsException(count); } // Note: offset or count might be near -1>>>1. if (offset > value.length - count) { throw new StringIndexOutOfBoundsException(offset + count); } this.value = new char[count]; this.count = count; System.arraycopy(value, offset, this.value, 0, count); }
источник
Как оставить в Java-строке только буквы и цифры
Try
return value.replaceAll("[^A-Za-z0-9]", "");
or
return value.replaceAll("[\\W]|_", "");
Как на Java проверить, что строка является палиндромом
public static Boolean isPalindrome(String s) { return s.equals((new StringBuilder(s)).reverse().toString()); }
Как посчитать факториал на Java
public static BigInteger factorial(int value){
if(value < 0){
throw new IllegalArgumentException("Value must be positive");
}
BigInteger result = BigInteger.ONE;
for (int i = 1; i <= value; i++) {
result = result.multiply(BigInteger.valueOf(i));
}
return result;
}
Дайджест по саморазвитию в программировании №12
Agile Modeling (AM) Home Page: Effective Practices for Modeling and Documentation
Class Diagram Relationships UML | Examples Relationships Class Diagram
Паттерн Mapper - Распределитель
Message Factory and Message Interface Design Pattern
Модульный дизайн или «что такое DIP, SRP, IoC, DI и т.п.»
Stack Overflow:
iphone - How to make an progress bar for an NSURLConnection when downloading a file?
iphone - Implementing NSURLConnectionDataDelegate Protocol
Class Diagram Relationships UML | Examples Relationships Class Diagram
Паттерн Mapper - Распределитель
Message Factory and Message Interface Design Pattern
Модульный дизайн или «что такое DIP, SRP, IoC, DI и т.п.»
Stack Overflow:
iphone - How to make an progress bar for an NSURLConnection when downloading a file?
iphone - Implementing NSURLConnectionDataDelegate Protocol
Технологии параллелизации на Java
- Модель акторов — Википедия
- OpenCL — Википедия
- OpenMP — Википедия
- Обзор java.util.concurrent.* / Блог компании Luxoft / Хабрахабр
- jcuda.org - Java bindings for CUDA
- Hadoop — Википедия
- Akka для Java разработчика (часть 1) / Хабрахабр
- Parallel Collections - Overview - Scala Documentation
- Apache Spark™ - Lightning-Fast Cluster Computing
- Thread (Java Platform SE 8 )
- Программная транзакционная память — Википедия
Шаблоны проектирования Java для начинающих. Бесплатный пошаговый видеокурс с исходными кодами
Применение шаблонов + знания ООП = профессиональный программист.
Эта простая формула, но соблюдают ее немногие.
Как работают статические переменные на разных платформах
Сегодня задался вопросом как работают статические переменные на разных платформах, например, на Java VM + JBoss Portal.
Подписаться на:
Сообщения (Atom)