Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - System.out.print is overlapping the questions why? -


my problem when run program runs system.out.print right when run second student of overlaps so:

"enter second student's name: enter student's score: " 

instead of

"enter second students's name: "  "enter student's score: " 

i can not input data system.out.print method of second student

my main code error is:

system.out.print("enter first student's name: "); name = reader.nextline(); student1.setname(name); (int = 1; <= 3; i++){     system.out.print("enter students's score: ");     score = reader.nextint();     student1.setscore(i, score); }  system.out.print("enter second student's name: "); //overlaps(stays on same line) //also wont let me enter data here name = reader.nextline(); student2.setname(name); (int = 1; <= 3; i++){     system.out.print("enter students's score: "); //program skips here input //data     score = reader.nextint();     student2.setscore(i, score); } 

the part deals error class follows

public void setname(string nm){     name = nm; } 

try inserting:

reader.nextline(); 

...before

system.out.print("enter second student's name: "); 

.nextint() doesn't swallow newline input, next call nextline() gets newline character , returns empty string - , program continues, printing next line of output.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -