java: public void swap() {final int sBegin = beginA;final int sEnd = endA;beginA = beginB;endA = endB;beginB = sBegin;endB = sEnd;}
C#: public virtual void Swap(){int sBegin = beginA;int sEnd = endA;beginA = beginB;endA = endB;beginB = sBegin;endB = sEnd;}