serial communication with bluetooth hc-05 not working

The message from Replies #3 and #4 is that you can use Serial2 when using the HardwareSerial pins 16 and 17 on your Mega and it will perform very much better than using SoftwareSerial

SoftwareSerial only makes sense on an Uno or Nano because they only have 1 HardwareSerial port.

...R