I have two RJ45 ports and one Ethernet MAC can i interface them without using the switch. it has to be used in my final year engineering project
A single MAC (ASIC/chip) can only handle a single PHY (Ethernet port). You could temporarily switch the PHY back and forth (e.g. between an 8P8C port and an SFP port), but you can't use them both simultaneously.
A solution may be to use a small three-port switch (ASIC), with one port interfacing your project and two ports for outside communication. Note that preventing the outside ports from communicating with each other or preventing unwanted traffic in general you'd need to configure that switch appropriately.
The intermediate-switch approach is very common in embedded network devices. If done properly it's very close to having two distinct MACs (without the double bandwidth). It does add complexity to the project though.
Of course, there are dual MAC ASICs as well, but I don't think that's the question.