Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Stupid java question

Name: Anonymous 2009-11-22 6:21

Yes I know I should be programming in Lisp. Yes java sucks. I'm a noob. OK.

I just want to know, how do I read a String from Scanner?
Like suppose I have

Scanner keyboard = new keyboard(System.in);
System.out.println("What is yo name?");
//Is it something like
//String name = keyboard.nextString ?
I've only ever used scanner for numbers so I'm a bit lost here.

Name: Anonymous 2009-11-22 6:23

[code] tags please.

Name: Anonymous 2009-11-22 6:35

next()

Name: Anonymous 2009-11-22 6:37

Oh I was just about to say google answered that for me, but thanks for answering anyway. But now what's the difference between next() and nextLine()?

Name: Anonymous 2009-11-22 7:04

if (books[i] != null){
    //do stuff
}


Is this valid in java? i.e. can I compare an object with null?

Name: Anonymous 2009-11-22 7:09

lisp sucks.
java is awesome.

Name: Anonymous 2009-11-22 7:13

>>6
I know you're trolling, but if you say that, it only shows that you don't really know Lisp.

Name: Anonymous 2009-11-22 7:15

>>7
it's kinda pathetic that you refuse to believe there are people who don't like Lisp.

Name: Anonymous 2009-11-22 7:17

>>8
I know you're trolling, but if you say that, it only shows that you don't really know Lisp.

Name: Anonymous 2009-11-22 7:18

>>8
>>7
>>6
answer >>5 please

Name: Anonymous 2009-11-22 7:18

>>8
Actually, it's that I refuse to believe there are people out there who like Java I'm sure there are some humans that like Java, but I don't consider them people

Name: Anonymous 2009-11-22 7:18

>>9
I'm lolling at you Lispers.

Name: Anonymous 2009-11-22 7:20

>>10
yes, you can compare an object with null.
you cannot compare primitive datatypes (such as int) to null however

Name: Anonymous 2009-11-22 7:33

>>11
I guess you could consider such people as dancers.

Name: Anonymous 2009-11-22 7:34

>>11
It is pretty pathetic of them (HWBT?), that they fell for such obvious bait.

Name: Anonymous 2009-11-22 7:42

>>14
wat?

Name: Anonymous 2009-11-22 7:53

>>16
He's turning scientists into dancers

Name: Anonymous 2009-11-22 10:01

>>14
are we human

Name: 2009-11-22 10:06



      ‮

Name: Anonymous 2009-11-22 10:25

>>18
no, we are cylons.

Name: Anonymous 2009-11-22 11:23

>>20
we are DEVO

Name: Anonymous 2009-11-22 11:35

Name: Anonymous 2009-11-22 13:37

How did I readed API docs?

Name: Anonymous 2009-11-22 18:21

If you're are deving in Java get NetBeans.
Then you don't need to wonder about the differences between 'keyboard.next();' and 'keyboard.nextLine()'.

Also I would assign a scanner object like this:

'Scanner kbd = new Scanner(System.in);'

I do not think 'new keyboard' is a legit object.

Also:

"if (books[i] != null){
    //do stuff
}"

So assuming books is an array of objects, you can indeed check if object at index i has been initialised.

Name: Anonymous 2009-11-22 20:16

nextInt - Next integer
next - next characters entered until there is a space
nextLn - Entire line

These are basics that I have picked up in college in about two weeks of learning.

As for lisp being better. Someone always says another language is better, always. Every year we do another language and there's always a better one we should be doing.

Name: Anonymous 2009-11-22 20:43

>>25
So just use Lisp. Then there won't be that better one.

Name: Anonymous 2009-11-22 22:08

Use Emacs! Emacs is the standard!

Name: Anonymous 2009-11-22 22:48

The best programming is done in FLASH

Name: Anonymous 2009-11-22 22:56

>>26
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
you fanboy retards crack me up

Name: Anonymous 2009-11-22 23:40

>>25

genuine retard

anyway, real answer to question: read the fucking javadocs

and tip: scanner will not consume the newline after you read in an int

Name: Anonymous 2010-12-17 1:24

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-01-31 20:03

<-- check em dubz

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List