Can use FixedUpdate in Update?

Hi, it’s my code

 void Update () {
     if (Input.GetKey (KeyCode.J)) {
         GetComponent<Rigidbody2D> ().velocity = new Vector2 (5,0);
     }

}

but the problem is that we should get inputs in Update and use all object that have Rigidbody2D in FixedUpdate

how can I get input in Update and then use RigidBody2D to move the object in FixedUpdate?

???

You can use a class level variable to separate your concerns. Also you should cache your Rigidbody2D for performance:

Vector2 force;
Rigidbody2D rb2d;
void Awake () {
    rb2d = GetComponent<Rigidbody2D> ();
}
void Update () {
    if (Input.GetKey (KeyCode.J)) {
        force = new Vector2 (5, 0);
     } else {
        force = Vector2.zero;
    }
}
void FixedUpdate () {
    rb2d.velocity = force;
}