Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.xml.sax.Attributes;

public class Main {
    public static int getIntAttribute(Attributes attr, String name, int defaultVal) {
        String value = attr.getValue(name);
        if (value == null)
            return defaultVal;

        try {
            return Integer.parseInt(value);
        } catch (Exception ex) {
            return defaultVal;
        }
    }
}