public class Takisti{ private double takistus, maxvoimsus; public Takisti(double t, double v){ takistus=t; maxvoimsus=v; } public double leiaVool(double pinge){ return pinge/takistus; } //N=U*I I=U/R => N=U*U/R U*U=N*R U=Math.sqrt(N*R); public double leiaMaxpinge(){ return Math.sqrt(maxvoimsus*takistus); } public double leiaMaxvool(){ return leiaVool(leiaMaxpinge()); } public double kysiTakistus(){ return takistus; } }