Why am I getting an error for actual and formal argument lists differ in length? [closed]

Trying to make it so pasting a 60 character long url, will print only the first 56 characters. I have only ever used Java in high school, so I am very inexperienced. import java.util.Scanner;

public class CopyOfCopyOfethanrun
{
public static void main()
{
    Scanner kb = new Scanner(System.in);
    link();
}

static void link(Scanner kb, String[] args)
{
    String link;

    System.out.print("nn Enter Link: ");
    link = kb.nextLine();
    
    String input = link;
    String firstfiftysix = "";
    
        if (input.length() > 56) 
        {firstfiftysix = input.substring(0, 56);} 
        else{firstfiftysix = input;
        }
        System.out.println(firstfiftysix);
    }
}

[Here is an image showing the error I am experiencing][1] [1]: https://i.stack.imgur.com/T6ux7.png

Answer

Your link method has 2 arguments: When invoking link, you need to provide [A] a Scanner instance, and [B] an instance of an array of Strings.

When you call link();, you provide neither of those. Presumably you want link(kb, args); there. Your main must look like:

public static void main(String[] args)

it currently doesn’t. Once you fix that, voila, you have your args. But, you should just get rid of that, you don’t use it anywhere in link.