79370137

Date: 2025-01-20 02:05:23
Score: 1
Natty:
Report link

for classes you can assign any type inside in angled brackets <>

class testing<T>{
     T val;
     public testing(T val){
         this.val=val;
     }
}
... in the main:
testing<Integer> test = new testing(1);

this is similar to how you would do it in C++ with templates

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Hugurs