import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
double lat=37.372;
double longitude= -122.038;

HttpRequest request = HttpRequest.newBuilder()
		//.uri(URI.create("https://yahoo-weather5.p.rapidapi.com/weather?lat=37.372&long=-122.038&format=json&u=f"))
		.uri(URI.create("https://yahoo-weather5.p.rapidapi.com/weather?lat="+lat+"&long="+longitude+"&format=json&u=f"))
		.header("X-RapidAPI-Key", "a53d1a4acemsh90db192dc27d5f7p1028a2jsn2e483944f85c")
		.header("X-RapidAPI-Host", "yahoo-weather5.p.rapidapi.com")
		.method("GET", HttpRequest.BodyPublishers.noBody())
		.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

a
{"location":{"city":"Sunnyvale","region":" CA","woeid":2502265,"country":"United States","lat":37.371609,"long":-122.038254,"timezone_id":"America/Los_Angeles"},"current_observation":{"wind":{"chill":68,"direction":338,"speed":16},"atmosphere":{"humidity":59,"visibility":9.01,"pressure":30.01,"rising":0},"astronomy":{"sunrise":"7:5 am","sunset":"6:49 pm"},"condition":{"code":32,"text":"Sunny","temperature":70},"pubDate":1664816100},"forecasts":[{"day":"Mon","date":1664769600,"low":57,"high":73,"text":"Mostly Sunny","code":34},{"day":"Tue","date":1664856000,"low":57,"high":75,"text":"Partly Cloudy","code":30},{"day":"Wed","date":1664942400,"low":56,"high":79,"text":"Mostly Sunny","code":34},{"day":"Thu","date":1665028800,"low":58,"high":80,"text":"Mostly Sunny","code":34},{"day":"Fri","date":1665115200,"low":60,"high":80,"text":"Mostly Sunny","code":34},{"day":"Sat","date":1665201600,"low":59,"high":79,"text":"Mostly Sunny","code":34},{"day":"Sun","date":1665288000,"low":57,"high":79,"text":"Mostly Sunny","code":34},{"day":"Mon","date":1665374400,"low":58,"high":78,"text":"Mostly Sunny","code":34},{"day":"Tue","date":1665460800,"low":56,"high":74,"text":"Partly Cloudy","code":30},{"day":"Wed","date":1665547200,"low":53,"high":77,"text":"Mostly Sunny","code":34},{"day":"Thu","date":1665633600,"low":52,"high":76,"text":"Sunny","code":32}]}
|   String json_String_to_print = ...
illegal start of expression
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Api{
  
 double lat;
 double longitude;

  
   Api(double lat, double longitude) {
 this.lat= lat;
 this.longitude= longitude;
   }

   public void Call()
   {
      HttpRequest request = HttpRequest.newBuilder()
		//.uri(URI.create("https://yahoo-weather5.p.rapidapi.com/weather?lat=37.372&long=-122.038&format=json&u=f"))
		.uri(URI.create("https://yahoo-weather5.p.rapidapi.com/weather?lat="+this.lat+"&long="+this.longitude+"&format=json&u=f"))
		.header("X-RapidAPI-Key", "a53d1a4acemsh90db192dc27d5f7p1028a2jsn2e483944f85c")
		.header("X-RapidAPI-Host", "yahoo-weather5.p.rapidapi.com")
		.method("GET", HttpRequest.BodyPublishers.noBody())
		.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
  
   }
   


}

public class driver{

   Public static void main(String[] args){
      Api first=new Api(37.372,-122.038);
      new.Call();
          
          
         }

}


   


driver.main(null);
|   HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
unreported exception java.io.IOException; must be caught or declared to be thrown