fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.lang.reflect.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. Class string = String.class;
  14.  
  15. System.out.println("Package: " + string.getPackage());
  16. System.out.println("Fields: " + java.util.Arrays.toString(string.getFields()));
  17. Method[] methods = string.getMethods();
  18.  
  19. for(int i = 0; i < 10; i++){
  20. System.out.println(methods[i]);
  21. }
  22.  
  23. }
  24. }
Success #stdin #stdout 0.08s 380224KB
stdin
Standard input is empty
stdout
Package: package java.lang, Java Platform API Specification, version 1.7
Fields: [public static final java.util.Comparator java.lang.String.CASE_INSENSITIVE_ORDER]
public boolean java.lang.String.equals(java.lang.Object)
public java.lang.String java.lang.String.toString()
public int java.lang.String.hashCode()
public int java.lang.String.compareTo(java.lang.Object)
public int java.lang.String.compareTo(java.lang.String)
public int java.lang.String.indexOf(java.lang.String,int)
public int java.lang.String.indexOf(int)
public int java.lang.String.indexOf(int,int)
public int java.lang.String.indexOf(java.lang.String)
public static java.lang.String java.lang.String.valueOf(float)