Skip to content

Api hw#9

Merged
lesyaAn merged 4 commits intomasterfrom
api_hw
Dec 5, 2019
Merged

Api hw#9
lesyaAn merged 4 commits intomasterfrom
api_hw

Conversation

@lesyaAn
Copy link
Copy Markdown
Owner

@lesyaAn lesyaAn commented Nov 21, 2019

No description provided.

Copy link
Copy Markdown

@sergeylukichev sergeylukichev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request contains way to many tasks from previous lessons and should be split.

private Address address;
private List<Phones> phones;


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why so many empty lines?

Person person = mapper.readValue(new File("persons.json"), Person.class);
System.out.println(person);
*/
String url = "http://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=0e2441af1b772fa31363023705b6351c";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think of making the code an application: reusable, testable and shippable so others could start it and specify a city other than London without modifying the code and recompiling it. Hint: think which classes could be in the application, which fields/properties they have? You should not probably disclose the url string since it contains APPID, which is you personal secret information.

@lesyaAn lesyaAn merged commit 15febad into master Dec 5, 2019
Copy link
Copy Markdown
Owner Author

@lesyaAn lesyaAn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package de.telran;

import org.w3c.dom.css.Counter;

public class Main {

public static void main(String[] args) throws InterruptedException {

    Counter counter = new Counter();

    ThreadIntegersThread thread1 = new ThreadIntegersThread(counter);
    ThreadIntegersRunnable thread2 = new ThreadIntegersRunnable(counter);

    Thread thread = new Thread(thread2);


    thread1.start();
    thread.start();

    thread1.join();
    thread.join();

    System.out.println(thread1.getCounter());
    System.out.println(thread2.getCounter());

}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants