<%! String str = \"prerna\"; %> >
just but the <%=str%> in double quotes this should work , i hope this is an answer to your question.
<%! String str = "prerna"; %>