Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import javax.annotation.Nonnull;

public class Main {
    private static int findTypeEnd(@Nonnull String str, int index) {
        char c = str.charAt(index);
        switch (c) {
        case 'Z':
        case 'B':
        case 'S':
        case 'C':
        case 'I':
        case 'J':
        case 'F':
        case 'D':
            return index + 1;
        case 'L':
            while (str.charAt(index++) != ';') {
            }
            return index;
        case '[':
            while (str.charAt(index++) != '[') {
            }
            return findTypeEnd(str, index);
        default:
            throw new IllegalArgumentException(String.format("Param string \"%s\" contains invalid type prefix: %s",
                    str, Character.toString(c)));
        }
    }
}