UNIX Total and Sort Java OOPS
UNIX Total and Sort Java OOPS
{
if($3=="finance")
total=total+$4;
}
END{
if(total==0)
print"No Asset Found";
else
print"Total Asset Price = "total;
}'
=================================================
import java.util.Scanner;
class Player
{
//Enter your Code here
int id;
int matchesPlayed;
int totalRuns;
String name;
String team;
Player(int id, int matchesPlayed, int totalRuns, String name, String team)
{
this.id = id;
this.matchesPlayed = matchesPlayed;
this.totalRuns = totalRuns;
this.name = name;
this.team = team;
}
public int getId()
{
return id;
}
public int getMatchesPlayed()
{
return matchesPlayed;
}
public int getTotalRuns()
{
return totalRuns;
}
public String getName()
{
return name;
}
public String getTeam()
{
return team;
}
}
min=players[i].getMatchesPlayed();
obj1=players[i];
}
return obj1;
pObj=players[i];
}
}
return pObj;