What does "PersonBean myBean =(PersonBean)request.getAttribute("myBean");" mean in Java? -


i learning java , came accross code example.

personbean mybean =(personbean)request.getattribute("mybean"); if(mybean=null) {   mybean = new personbean();   request.setattribute("mybean",mybean); } 

here personbean mybean =(personbean)request.getattribute("mybean"); doing? mean in if statement there statement constructs object of class . purpose of first line here? can break down me ?

this code gets "mybean" attribute request object (which contains incoming objects) , casts personbean. if not successful creates new personbean object name "mybean" , sets "mybean" object in request.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -