So on a switch you can creat a virtual interface called interface vlan 1
and assign an ip address to it.
SW1(config)#interface vlan 16
SW1(config-if)#ip address 192.168.16.1 255.255.255.0
SW1(config-if)#no shutdown
If I have a switchport in vlan 16
and a host is attached to the device on that port. You can assign a static ip address to it e.g. 192.168.16.100 255.255.255.0
default gateway: 192.168.16.1
you should be able to ping 192.168.16.1 sucessfully.