Tuesday, February 10, 2015

Hello.java

Sometimes I need a very simple java file in order to work on other class file project.
In order to reduce my workload on creating basic blocks, this is a very simple hello.java file:

import java.util.*;

public class hello{

    public static void main(String[] args) {
      
        Date d = new Date();
        System.out.println("Date: "+ d);

           
          int rollno = 3;                      
            
          if(rollno < 5 ){
              System.out.println("Hello, Your presentation is on wednesday!");
          } else {
        
              System.out.println("Hello, Your presentation is on next Monday!");

          }
        
          nextRollnumber(rollno);//calls another function

    }
    
     public static void nextRollnumber(int nextRoll){
     nextRoll++;
     System.out.println("Next Roll number is: "+nextRoll);
    
     }

}

No comments:

Post a Comment