Search:

Type: Posts; User: Random1

Search: Search took 0.13 seconds.

  1. Replies
    6
    Views
    167

    Re: else if statement

    So I'm confused what to do then...all I need is to print the unknown type if the users input doesn't match that of the array
  2. Replies
    6
    Views
    167

    Re: else if statement

    import java.util.Scanner;

    class lab5{

    public static void main(String[] args){

    String[] type = {"byte", "short", "int", "long", "float", "double", "Boolean", "char",...
  3. Replies
    6
    Views
    167

    else if statement

    this is my code and i need to add in

    System.out.println("Unknown type: " + result[1]);

    when i add it after the first if statement it prints it out 8 times instead of once.

    so my question is...
Results 1 to 3 of 3