Giter Club home page Giter Club logo

exam2020's Introduction

간단한 코딩 테스트

어떤 Library를 사용 할 일이 생겼습니다.

TestLibrary lib = new TestLibrary();

두개의 함수를 순서대로 실행해주어야 합니다.

firstTask는 callback으로 결과를 주는 함수이고,
sendTask는 firstTask의 결과값을 필요로 합니다.

public class Main {
	public static void main(String[] args) {
		String result = tasks();
		System.out.println(result);
	}

	private static String tasks(){
		TestLibrary lib = new TestLibrary();

		final String[] result = new String[1];

		lib.firstTask(new Task() {
			@Override
			public void taskCallback(String s) {
				 result[0] = lib.secondTask(s);
			}
		});

		// FIXME always null.
		return result[0];
	}
}

그런데, 생각했던대로 동작하지 않네요...

tasks함수가 lib.secondTask() 함수의 값을 잘 반환할 수 있도록 우측 상단의 Fork 버튼을 통해 내 GitHub로 복사하고, 금요일 12:00까지 각자 수정을 완료해주세요!

검색해서 답을 찾아도 좋고, 친구들과 함께 풀어도 좋습니다.
해결방법을 찾을 수 있었던 과정을 주석 한 줄정도로 써주시기 바랍니다.

exam2020's People

Contributors

gheejeon avatar bungabear avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.