Fri. Dec 6th, 2019

Host your Website

Read and learn

FatCow Web Hosting $1.00/mo* Trust your web hosting to the #1 web host provider, GoDaddy!

Java Programming Ep. 3: Strings & Scanner Input

1 min read



Check us out at http://modcrafter.com

% means Remainder
Example:
20 % 3 = 2. This is because 3 divides into 20, 6 times with remainder of 2

Java Programming Ep. 3

Topic: Strings & Scanner Input

Difficulty: Easy

Prerequisites: Knowledge of Variables

Ep. 1: What is a Main Class: http://www.youtube.com/watch?v=V9eTwPjNicQ
Ep. 2: Variables: https://www.youtube.com/watch?v=RfVBC_2eUR8

26 thoughts on “Java Programming Ep. 3: Strings & Scanner Input

  1. My friend, thank you very much for your tutorial. I was stuck with an assignment that was due yesterday, but it is all thanks to your straight to the point demos, I was able to complete my code, as I am really new at coding. I am definitely looking forward to view more of your online work. Your presentation is 10 times better than that of my professor here at the university with a (PHd). that guy is all over during his lecture; thus making it impossible to learn one section at the time, and not taking into account that the majority of the class does not know too much about java.

  2. Hey, Just like to say thank you very much I have a difficult time trying to understand scanners. Had a book that try to explain it but was terrible. Your method was spot on. Thanks Definitely subscribing to you thanks again

  3. When I run your code and enter like 12.05 I get an error:
    "Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Scanner.java:864)
    at java.util.Scanner.next(Scanner.java:1485)
    at java.util.Scanner.nextDouble(Scanner.java:2413)
    at thebook.TheBook.main(TheBook.java:23)

    EDIT: it works fine when I use comma… eh?

  4. I've copied everything you have written but I get this error(my class(?) is named string.java):
    run:
    Enter an amount in double format, for example: 12.05
    6.83
    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Scanner.java:909)
    at java.util.Scanner.next(Scanner.java:1530)
    at java.util.Scanner.nextDouble(Scanner.java:2456)
    at strings.Strings.main(Strings.java:16)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 3 seconds)

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.