This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WhileTest { | |
static boolean condition() { | |
boolean result = Math.random() < 0.99; | |
System.out.print(result + ", "); | |
return result; | |
} | |
public static void main(String[] args) { | |
while(condition()) | |
System.out.println("Inside 'while'"); | |
System.out.println("Exited 'while'"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Vitalik on 05.05.2014. | |
*/ | |
public class BotlesOfBeer | |
{ | |
public static void main(String[] args){ | |
int k = 99; | |
while (k > 0){ | |
System.out.printf( | |
"%d bottle%s of beer on the wall ,\n" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson06.task04; | |
/* 5 строчек в начало списка | |
1. Создай список строк. | |
2. Добавь в него 5 строчек с клавиатуры, но только добавлять не в конец списка, а в начало. | |
3. Используя цикл выведи содержимое на экран, каждое значение с новой строки. | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson06.task05; | |
/* Удали последнюю строку и вставь её в начало | |
1. Создай список строк. | |
2. Добавь в него 5 строчек с клавиатуры. | |
3. Удали последнюю строку и вставь её в начало. Повторить 13 раз. | |
4. Используя цикл выведи содержимое на экран, каждое значение с новой строки. | |
*/ | |
import java.io.BufferedReader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson09.task01; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.*; | |
/* Три массива | |
1. Введи с клавиатуры 20 чисел, сохрани их в список и рассортируй по трём другим спискам: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson09.task03; | |
import com.sun.org.apache.xpath.internal.SourceTree; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
/* Слово «именно» |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson09.task03; | |
import com.sun.org.apache.xpath.internal.SourceTree; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
/* Слово «именно» |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson09.task04; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
/* Буква «р» и буква «л» | |
1. Создай список слов, заполни его самостоятельно. | |
2. Метод fix должен: | |
2.1. удалять из списка строк все слова, содержащие букву «р» |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson09.task05; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
/* Удвой слова | |
1. Введи с клавиатуры 10 слов в список строк. | |
2. Метод doubleValues должен удваивать слова по принципу a,b,c -> a,a,b,b,c,c. | |
3. Используя цикл for выведи результат на экран, каждое значение с новой строки. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level07.lesson12.home01; | |
import com.sun.org.apache.xpath.internal.SourceTree; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.List; |
OlderNewer