Using charAt method, won't add them as an Int, and wont print as string. Will explain better

后端 未结 4 1259
旧时难觅i
旧时难觅i 2021-01-27 17:58

Alright, so here is my code:

import java.util.Scanner;

public class CarRental {

    public static String model;
    public static int letternum;
    public st         


        
4条回答
  •  悲&欢浪女
    2021-01-27 18:11

    You want to take the second part of the string (with the three numbers) and add it to your total. You can take that value with:

    Integer.parseInt(plate.split(" ")[1])

提交回复
热议问题