Hi all, can anybody help me please. Have three questions.
1. how function private String addHttp(String site) knows where to save/to assign output from return?
2.Whats the meaning of variable (site) in brackets...at the end of this line.. site = site.startsWith("http") ? site : addHttp(site);
3. String site and then site is the same , right? (Line 2 and line 3 of code)
Thanks for helping
1. how function private String addHttp(String site) knows where to save/to assign output from return?
2.Whats the meaning of variable (site) in brackets...at the end of this line.. site = site.startsWith("http") ? site : addHttp(site);
3. String site and then site is the same , right? (Line 2 and line 3 of code)
Thanks for helping
Code:
public void moreTernary(){
String site= "www.eviltester.com";
site = site.startsWith("http") ? site : addHttp(site); // ?
}
private String addHttp(String site)
return "http://" + site;