in toturials, it say to invoke a method from external package first it is needed to create an object from the class, and then use the period to invoke the method:
1. packageclassname objectname = new packageclassname();
2. objectname.themethod();
but most the libraries found on the net, use the method like this:
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public class FirstJsoupExample{
public static void main( String[] args ) throws IOException{
Document doc = Jsoup.connect("http://www.javatpoint.com").get();
String title = doc.title();
System.out.println("title is: " + title);
}
}
what is exactly the
Document doc = Jsoup.connect("http://www.javatpoint.com").get();
section? since it doesn't look like creating an object neither apears like invoking a method using an onject name?
What I have tried:
in several toturials on the net, including the oracle toturial, they all use the usual way which is mentionaed at the first:
1. packageclassname objectname = new packageclassname();
2. objectname.themethod();