MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
Mime type: application/x-java-serialized-object; class=java.lang.String
Primary type: application
Subtype: x-java-serialized-object
Name: Unicode String
Representation class: class java.lang.String
    
Mime type: application/x-java-file-list; class=java.util.List
Primary type: application
Subtype: x-java-file-list
Name: application/x-java-file-list
Representation class: interface java.util.List
    
*/
import java.awt.datatransfer.DataFlavor;

public class MainClass {

    public static void main(String[] args) {

        DataFlavor df = DataFlavor.stringFlavor;

        System.out.println("Mime type: " + df.getMimeType());
        System.out.println("Primary type: " + df.getPrimaryType());
        System.out.println("Subtype: " + df.getSubType());
        System.out.println("Name: " + df.getHumanPresentableName());
        String s = df.getRepresentationClass().toString();
        System.out.println("Representation class: " + s + "\n");

        df = DataFlavor.javaFileListFlavor;

        System.out.println("Mime type: " + df.getMimeType());
        System.out.println("Primary type: " + df.getPrimaryType());
        System.out.println("Subtype: " + df.getSubType());
        System.out.println("Name: " + df.getHumanPresentableName());
        s = df.getRepresentationClass().toString();
        System.out.println("Representation class: " + s);
    }
}