MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
 * Output:
   Length: 0
   Capacity:40
 * */

public class MainClass {
    public static void main(String args[]) {
        StringBuffer sb = new StringBuffer(40);
        System.out.println(sb);
        System.out.println("Length: " + sb.length());
        System.out.println("Capacity:" + sb.capacity());
    }
}