Performing conditional logic on a text area field

I am trying to perform conditional logic on a text area field: if (textfield.length() < 1 ) { //do A"; } else { // do B } action B always gets performed - never A The same with: if (textfield == null) { //do A"; } else { // do B } B always gets actioned The same with: if (textfield.length() == 0 ) { Why is this the case