On Wednesday, Mr. Weaver, wearing a blue button-up shirt and khakis, and Mr. Lewis, who wore a camouflage jacket and gray jeans, stood next to each other as they listened to the murder and robbery charges being read in court.

Both whispered to the judge that they were 14-year-olds and uttered the words “not guilty” when asked to enter a plea.

Mr. Weaver and Mr. Lewis were ordered held without bail at a juvenile detention facility.

The killing of Ms. Majors, who had come from Virginia to study at Barnard, recalled a more violent era in the city when park muggings and murders were far more common.

Her killing also echoed the notorious 1989 April attack on a jogger in Central Park. Investigators and prosecutors relied then on tough interrogation techniques to obtain confessions from five teenagers accused of the brutal assault and rape of the jogger.

The confessions were later proven to be false.

In the long shadow of that case, the authorities said they made sure to take extra steps to ensure that a guardian or a lawyer was present each time one of the teenagers accused of taking part in Ms. Majors’s killing was questioned by investigators.

But lawyers with the Legal Aid Society, which represents the 13-year-old defendant, have argued in court hearings that their client was subjected to aggressive interrogation tactics, including browbeating and screaming. That defendant is not accused of killing Ms. Majors but is accused of being involved in the robbery that led to her death.

The New York Times is not naming the 13-year-old because he is not being charged as an adult. He is expected to face trial for his role in the murder in family court in March.