get paid to paste

java-tut-variables-data-type-var-type-name-2

public class SampleClass{
  
  //valid method name
  static void var(String s){
    
    //valid variable name
    var var = s;
    System.out.println(var);
  }
  
  public static void main(String[] args){
  
    SampleClass.var("Hello!");
  }
}

//compile-time error
/*
class var{
}
*/

Pasted: Nov 28, 2024, 8:00:49 am
Views: 8