This file contains 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 files; | |
import java.io.File; | |
import java.io.IOException; | |
import javax.sound.sampled.AudioInputStream; | |
import javax.sound.sampled.AudioSystem; | |
import javax.sound.sampled.Clip; | |
import javax.sound.sampled.LineUnavailableException; | |
import javax.sound.sampled.UnsupportedAudioFileException; |
This file contains 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 files; | |
import java.io.*; | |
public class Program { | |
static String path = "C:\\1\\data.txt"; | |
public static void main(String[] args) { |
This file contains 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 files; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.Random; | |
import java.util.Vector; |
This file contains 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
<?xml version="1.0"?> | |
<?xml-stylesheet type="text/css" href="advert.css"?> | |
<advert> | |
Предлагаем вашему вниманию новый <room>3</room>-х камерный <product>холодильник</product> | |
<product_title>"Горск"</product_title> объемом <volume>250</volume> л. и стоимостью всего | |
<price>9000</price> грн! Новый дизайн, <feature>быстрое охлаждение</feature> и | |
<feature>низкое энергопотребление</feature>, <garant>3-х годовая гарантия</garant> на все узлы и агрегаты, | |
а так же <service>бесплатная доставка по городу</service>! Заказывайте прямо сейчас по тел. | |
<phone>222-33-22</phone>. |
This file contains 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 xml; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.DocumentBuilder; | |
import org.w3c.dom.Document; | |
import org.w3c.dom.NodeList; | |
import org.w3c.dom.Node; | |
import org.w3c.dom.Element; | |
import java.io.File; | |
import java.io.IOException; |
This file contains 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
<?xml version="1.0"?> | |
<company> | |
<staff id="1"> | |
<firstname>Arya</firstname> | |
<lastname>Stark</lastname> | |
<nickname>Noname</nickname> | |
<salary>10000</salary> | |
</staff> | |
<staff id="2"> | |
<firstname>John</firstname> |
This file contains 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 serialization; | |
public class AdmittedGroup { // нужен отдельный java файл AdmittedGroup.java!!! | |
public Student first = new Student("Natalie"); | |
public Student second = new Student("Olga"); | |
public Student third = new Student("Stanislav"); | |
public Student fourth = new Student("Valentine"); | |
public Student fifth = new Student("Artem"); |
This file contains 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 serialization; | |
import com.google.gson.Gson; | |
import java.io.*; | |
class Program { | |
public static void main(String[] args) throws FileNotFoundException, IOException { | |
Gson gson = new Gson(); |
This file contains 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 serialization; | |
import com.google.gson.Gson; | |
class Student { | |
private String name; | |
private int age = (int) (Math.random() * 20 + 20); | |
public Student(String name) { |
This file contains 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 reflection; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
class Student { | |
private String name; | |
private int age = (int) (Math.random() * 20 + 20); |