Skip to content

Instantly share code, notes, and snippets.

@jamesattard
Created December 6, 2015 16:03
Show Gist options
  • Select an option

  • Save jamesattard/41ea97cbf6c62838321e to your computer and use it in GitHub Desktop.

Select an option

Save jamesattard/41ea97cbf6c62838321e to your computer and use it in GitHub Desktop.
non-static method from static method
package com.example.helloworld;
public class HelloWorld
{
public void sayHelloFromFile(){
FileResource resource = new FileResource("hello_unicode.txt");
for(String line : resource.lines()){
System.out.println(line);
}
}
public static void main(String[] args) {
HelloWorld hw = new HelloWorld();
hw.sayHelloFromFile();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment