Results 1 to 20 of 20

Thread: static method

Threaded View

  1. #12
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Code:
    public class returntest{
      public static void main(String[] args){
       test t = test.returnme();
       
       
       System.out.println(t.teststring);
     }
    }
    class test{
       String teststring = "Hello"; 
       public static test returnme(){return new test();} 
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width