PRM392Xuất hiện trong 1 đề thi
Which of the following is a correct way to create an instance of a Retrofit API interface?
Các lựa chọn
ARetrofit retrofit = new Retrofit(); MyApiEndpointInterface api = retrofit.create(MyApiEndpointInterface.class);
BRetrofit retrofit = Retrofit.create(); MyApiEndpointInterface api = retrofit.newInstance(MyApiEndpointInterface.class);
CRetrofit retrofit = new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build(); MyApiEndpointInterface api = retrofit.create(MyApiEndpointInterface.class);
DRetrofit retrofit = Retrofit.newInstance(BASE_URL); MyApiEndpointInterface api = retrofit.createInstance(MyApiEndpointInterface.class);