Monday, April 11, 2016

Java programming Language Code Examples-Scanner(4)

Smiley face

Code:

Smiley face

Output:

Smiley face

Code:

Smiley face

Output:

Smiley face

note:

     int       -    nextInt()
     String    -    next()
                    nextLine()
     char      -    next().charAt(0)
     double    -    nextDouble()
     long      -    nextLong()
     boolean   -    nextBoolean() 

Code:

Smiley face

Output:

Smiley face

note:

Different between next() & nextLine()
next() - take string untill a space
nextLine() - take string untill next line

No comments:

Post a Comment

Wel Come !!! computer express