Gautam's Blog

The technical blog of Gautam!

Browsing Posts in Java

So what are inner classes good for anyway?

Java Generics

Handling memory leaks in Java programs

A good article.

MaxMind offers GeoIP database. It allows you to plot the location of the IP addresses using country information or more precise information such as the latitude and longitude of the location of the IP address.

 try {
        // Create the reader
        String filename = "infile.txt";
        String patternStr = "pattern";
        BufferedReader rd = new BufferedReader(new FileReader(filename));

        // Create the pattern
        Pattern pattern = Pattern.compile(patternStr);
        Matcher matcher = pattern.matcher("");

        // Retrieve all lines that match pattern
        String line = null;
        while ((line = rd.readLine()) != null) {
            matcher.reset(line);
            if (matcher.find()) {
                // line matches the pattern
            }
        }
    } catch (IOException e) {
    }

Java Program to chart information.

I was working with gnu version of rmic. I noticed that when I compiled with it, it gave me java.lang.exception. I compiled it with Sun’s JDK and it did not throw an error.

Now, why would I get an exception while compiling? Exceptions by definition occur only during runtime. Vikram believes that there might be a problem with gnu’s implementation of Java specification.

Java

No comments

int is an primitive data type; an object. However, any object in java has .tostring() method as all objects need to implement toString method. An integer object is not an object in the strictest sense then as toString() does not exist. To get the string object, Interger.toString(int) is required.

So, is Java object oriented?

Powered by WordPress Web Design by SRS Solutions © 2012 Gautam's Blog Design by SRS Solutions