[MINOR][DOCS] Updates to the Accumulator example in the programming guide. Fixed typos, AccumulatorV2 in Java
[MINOR][DOCS] Updates to the Accumulator example in the programming guide. Fixed typos, AccumulatorV2 in Java

## What changes were proposed in this pull request?

This pull request contains updates to Scala and Java Accumulator code snippets in the programming guide.

- For Scala, the pull request fixes the signature of the 'add()' method in the custom Accumulator, which contained two params (as the old AccumulatorParam) instead of one (as in AccumulatorV2).

- The Java example was updated to use the AccumulatorV2 class since AccumulatorParam is marked as deprecated.

- Scala and Java examples are more consistent now.

## How was this patch tested?

This patch was tested manually by building the docs locally.

![image](https://cloud.githubusercontent.com/assets/6235869/20652099/77d98d18-b4f3-11e6-8565-a995fe8cf8e5.png)

Author: aokolnychyi <okolnychyyanton@gmail.com>

Closes #16024 from aokolnychyi/fixed_accumulator_example.

rednaxelafx/apache-spark,lvdongr/spark,HyukjinKwon/spark,patrick-nicholson/spark,facaiy/spark,bravo-zhang/spark,kiszk/spark,SHASHANKB/spark,kissmetrics/spark,rekhajoshm/spark,zhouyejoe/spark,ajaysaini725/spark,xflin/spark,ddna1021/spark,chuckchen/spark,brad-kaiser/spark,dhruve/spark,mdespriee/spark,minixalpha/spark,zero323/spark,bdrillard/spark,cloud-fan/spark,bdrillard/spark,maropu/spark,tengpeng/spark,HyukjinKwon/spark,yanboliang/spark,nilsgrabbert/spark,actuaryzhang/spark,michalsenkyr/spark,map222/spark,ron8hu/spark,lvdongr/spark,saltstar/spark,pgandhi999/spark,caneGuy/spark,SHASHANKB/spark,xflin/spark,holdenk/spark,byakuinss/spark,nilsgrabbert/spark,xflin/spark,ioana-delaney/spark,janewangfb/spark,debugger87/spark,chuckchen/spark,kevinyu98/spark,dbtsai/spark,highfei2011/spark,rikima/spark,jiangxb1987/spark,gengliangwang/spark,ueshin/apache-spark,caneGuy/spark,saltstar/spark,LantaoJin/spark,highfei2011/spark,aray/spark,cloud-fan/spark,rekhajoshm/spark,joseph-torres/spark,sachintyagi22/spark,HyukjinKwon/spark,someorz/spark,nchammas/spark,witgo/spark,dongjoon-hyun/spark,rezasafi/spark,wangmiao1981/spark,lxsmnv/spark,JoshRosen/spark,bdrillard/spark,panfengfeng/spark,holdenk/spark,sachintyagi22/spark,mahak/spark,rekhajoshm/spark,huang1900/spark,skonto/spark,spark-test/spark,esi-mineset/spark,stanzhai/spark,mdespriee/spark,JerryLead/spark,techaddict/spark,aosagie/spark,dhruve/spark,poffuomo/spark,huang1900/spark,darionyaphet/spark,JoshRosen/spark,techaddict/spark,sahilTakiar/spark,xflin/spark,jianran/spark,esi-mineset/spark,jiangxb1987/spark,skonto/spark,WindCanDie/spark,narahari92/spark,wzhfy/spark,cloud-fan/spark,adrian-ionescu/apache-spark,BryanCutler/spark,jianran/spark,vinodkc/spark,zzcclp/spark,wangyum/spark,dbtsai/spark,adrian-ionescu/apache-spark,JoshRosen/spark,zzcclp/spark,apache-spark-on-k8s/spark,holdenk/spark,mike0sv/spark,guoxiaolongzte/spark,Aegeaner/spark,mike0sv/spark,cin/spark,zuotingbing/spark,adrian-ionescu/apache-spark,bdrillard/spark,goldmedal/spark,ericvandenbergfb/spark,bdrillard/spark,jrshust/spark,setjet/spark,holdenk/spark,bOOm-X/spark,UndeadBaneGitHub/spark,srowen/spark,andrewor14/spark,bOOm-X/spark,debugger87/spark,jlopezmalla/spark,saltstar/spark,markhamstra/spark,mahak/spark,bravo-zhang/spark,nilsgrabbert/spark,apache-spark-on-k8s/spark,aosagie/spark,shaneknapp/spark,dongjoon-hyun/spark,rekhajoshm/spark,liutang123/spark,huang1900/spark,highfei2011/spark,narahari92/spark,debugger87/spark,SHASHANKB/spark,shaneknapp/spark,tejasapatil/spark,caneGuy/spark,srowen/spark,loneknightpy/spark,alunarbeach/spark,setjet/spark,zero323/spark,rikima/spark,lvdongr/spark,poffuomo/spark,skonto/spark,setjet/spark,alunarbeach/spark,ajaysaini725/spark,LantaoJin/spark,ddna1021/spark,xuanyuanking/spark,nlalevee/spark,saturday-shi/spark,markhamstra/spark,witgo/spark,ConeyLiu/spark,wzhfy/spark,zuotingbing/spark,goldmedal/spark,zero323/spark,aray/spark,jkbradley/spark,aosagie/spark,eyalfa/spark,ioana-delaney/spark,apache-spark-on-k8s/spark,ajaysaini725/spark,rekhajoshm/spark,xuanyuanking/spark,ioana-delaney/spark,hvanhovell/spark,wangyum/spark,actuaryzhang/spark,patrick-nicholson/spark,publicRoman/spark,xflin/spark,ptkool/spark,dhruve/spark,UndeadBaneGitHub/spark,kevinyu98/spark,kevinyu98/spark,joseph-torres/spark,lvdongr/spark,jrshust/spark,apache-spark-on-k8s/spark,WindCanDie/spark,zhouyejoe/spark,mike0sv/spark,SHASHANKB/spark,mdespriee/spark,shubhamchopra/spark,someorz/spark,lvdongr/spark,eyalfa/spark,wangyum/spark,zzcclp/spark,goldmedal/spark,nlalevee/spark,alunarbeach/spark,WeichenXu123/spark,liutang123/spark,nlalevee/spark,stanzhai/spark,bravo-zhang/spark,liyichao/spark,jkbradley/spark,sureshthalamati/spark,markhamstra/spark,wzhfy/spark,patrick-nicholson/spark,gengliangwang/spark,zhouyejoe/spark,techaddict/spark,andrewor14/spark,nilsgrabbert/spark,aosagie/spark,taroplus/spark,setjet/spark,sachintyagi22/spark,michalsenkyr/spark,zzcclp/spark,ptkool/spark,jianran/spark,mahak/spark,shubhamchopra/spark,loneknightpy/spark,huang1900/spark,rikima/spark,stanzhai/spark,Aegeaner/spark,rezasafi/spark,joseph-torres/spark,jrshust/spark,JerryLead/spark,wangmiao1981/spark,facaiy/spark,rednaxelafx/apache-spark,jiangxb1987/spark,gengliangwang/spark,szhem/spark,guoxiaolongzte/spark,srowen/spark,JerryLead/spark,shuangshuangwang/spark,alunarbeach/spark,rikima/spark,holdenk/spark,mahak/spark,UndeadBaneGitHub/spark,MLnick/spark,minixalpha/spark,WeichenXu123/spark,patrick-nicholson/spark,hhbyyh/spark,dongjoon-hyun/spark,matthewfranglen/spark,michalsenkyr/spark,kevinyu98/spark,rezasafi/spark,pgandhi999/spark,jiangxb1987/spark,saturday-shi/spark,lxsmnv/spark,janewangfb/spark,szhem/spark,milliman/spark,milliman/spark,hhbyyh/spark,Aegeaner/spark,nilsgrabbert/spark,dhruve/spark,narahari92/spark,darionyaphet/spark,bravo-zhang/spark,taroplus/spark,mike0sv/spark,dongjoon-hyun/spark,janewangfb/spark,kiszk/spark,actuaryzhang/spark,spark-test/spark,ddna1021/spark,sureshthalamati/spark,mdespriee/spark,yanboliang/spark,WindCanDie/spark,ericvandenbergfb/spark,goldmedal/spark,dbtsai/spark,wangyum/spark,cloud-fan/spark,liutang123/spark,icexelloss/spark,maropu/spark,chuckchen/spark,someorz/spark,chuckchen/spark,chuckchen/spark,UndeadBaneGitHub/spark,minixalpha/spark,brad-kaiser/spark,wangyum/spark,maropu/spark,rednaxelafx/apache-spark,guoxiaolongzte/spark,map222/spark,ConeyLiu/spark,loneknightpy/spark,loneknightpy/spark,szhem/spark,ericvandenbergfb/spark,michalsenkyr/spark,patrick-nicholson/spark,HyukjinKwon/spark,bravo-zhang/spark,rednaxelafx/apache-spark,sureshthalamati/spark,liyichao/spark,pgandhi999/spark,poffuomo/spark,liyichao/spark,rezasafi/spark,lxsmnv/spark,shaneknapp/spark,tejasapatil/spark,zuotingbing/spark,nchammas/spark,sureshthalamati/spark,JerryLead/spark,aray/spark,janewangfb/spark,bOOm-X/spark,zuotingbing/spark,aokolnychyi/spark,eyalfa/spark,kiszk/spark,WeichenXu123/spark,panfengfeng/spark,JoshRosen/spark,tengpeng/spark,ahnqirage/spark,vinodkc/spark,cin/spark,zero323/spark,apache/spark,debugger87/spark,ron8hu/spark,xflin/spark,JoshRosen/spark,ahnqirage/spark,facaiy/spark,gengliangwang/spark,icexelloss/spark,ron8hu/spark,loneknightpy/spark,rekhajoshm/spark,mzl9039/spark,darionyaphet/spark,ron8hu/spark,saturday-shi/spark,akopich/spark,nlalevee/spark,ioana-delaney/spark,someorz/spark,bOOm-X/spark,actuaryzhang/spark,LantaoJin/spark,szhem/spark,kiszk/spark,milliman/spark,ericvandenbergfb/spark,shuangshuangwang/spark,ConeyLiu/spark,cin/spark,jkbradley/spark,brad-kaiser/spark,ptkool/spark,liutang123/spark,facaiy/spark,ueshin/apache-spark,maropu/spark,WindCanDie/spark,HyukjinKwon/spark,mahak/spark,icexelloss/spark,ueshin/apache-spark,rezasafi/spark,szhem/spark,hhbyyh/spark,rekhajoshm/spark,spark-test/spark,akopich/spark,milliman/spark,nchammas/spark,vinodkc/spark,mdespriee/spark,aosagie/spark,witgo/spark,rikima/spark,akopich/spark,zuotingbing/spark,tengpeng/spark,techaddict/spark,dbtsai/spark,facaiy/spark,SHASHANKB/spark,apache/spark,wzhfy/spark,zuotingbing/spark,ron8hu/spark,byakuinss/spark,WeichenXu123/spark,patrick-nicholson/spark,1haodian/spark,nlalevee/spark,liyichao/spark,darionyaphet/spark,liyichao/spark,patrick-nicholson/spark,1haodian/spark,sachintyagi22/spark,tejasapatil/spark,SHASHANKB/spark,taroplus/spark,mzl9039/spark,jlopezmalla/spark,sahilTakiar/spark,ueshin/apache-spark,narahari92/spark,LantaoJin/spark,mzl9039/spark,milliman/spark,saturday-shi/spark,rednaxelafx/apache-spark,kevinyu98/spark,alunarbeach/spark,highfei2011/spark,taroplus/spark,publicRoman/spark,sahilTakiar/spark,jlopezmalla/spark,darionyaphet/spark,ddna1021/spark,alunarbeach/spark,akopich/spark,aray/spark,ptkool/spark,mike0sv/spark,hvanhovell/spark,setjet/spark,jrshust/spark,loneknightpy/spark,ahnqirage/spark,kissmetrics/spark,ajaysaini725/spark,ptkool/spark,ueshin/apache-spark,zzcclp/spark,apache/spark,taroplus/spark,shaneknapp/spark,shubhamchopra/spark,chuckchen/spark,adrian-ionescu/apache-spark,Aegeaner/spark,jkbradley/spark,rezasafi/spark,byakuinss/spark,huang1900/spark,ahnqirage/spark,xuanyuanking/spark,tengpeng/spark,publicRoman/spark,kissmetrics/spark,icexelloss/spark,sahilTakiar/spark,xuanyuanking/spark,mzl9039/spark,dongjoon-hyun/spark,liyichao/spark,kiszk/spark,zero323/spark,cloud-fan/spark,xuanyuanking/spark,icexelloss/spark,xuanyuanking/spark,sureshthalamati/spark,brad-kaiser/spark,dongjoon-hyun/spark,joseph-torres/spark,hvanhovell/spark,bOOm-X/spark,tengpeng/spark,jianran/spark,highfei2011/spark,MLnick/spark,bravo-zhang/spark,byakuinss/spark,publicRoman/spark,WindCanDie/spark,map222/spark,gengliangwang/spark,rednaxelafx/apache-spark,shubhamchopra/spark,map222/spark,jrshust/spark,map222/spark,srowen/spark,kissmetrics/spark,cin/spark,1haodian/spark,vinodkc/spark,ptkool/spark,zuotingbing/spark,cin/spark,liyichao/spark,yanboliang/spark,akopich/spark,holdenk/spark,highfei2011/spark,actuaryzhang/spark,pgandhi999/spark,techaddict/spark,liutang123/spark,shuangshuangwang/spark,hhbyyh/spark,wangmiao1981/spark,cin/spark,ConeyLiu/spark,aokolnychyi/spark,jiangxb1987/spark,hhbyyh/spark,debugger87/spark,aosagie/spark,goldmedal/spark,publicRoman/spark,sachintyagi22/spark,stanzhai/spark,stanzhai/spark,byakuinss/spark,LantaoJin/spark,highfei2011/spark,eyalfa/spark,lxsmnv/spark,wzhfy/spark,wzhfy/spark,maropu/spark,ddna1021/spark,dbtsai/spark,dhruve/spark,poffuomo/spark,lxsmnv/spark,aray/spark,LantaoJin/spark,apache/spark,srowen/spark,goldmedal/spark,panfengfeng/spark,poffuomo/spark,rezasafi/spark,panfengfeng/spark,actuaryzhang/spark,mahak/spark,shaneknapp/spark,MLnick/spark,saltstar/spark,apache/spark,sachintyagi22/spark,publicRoman/spark,ericvandenbergfb/spark,kiszk/spark,ioana-delaney/spark,mdespriee/spark,sahilTakiar/spark,apache/spark,guoxiaolongzte/spark,esi-mineset/spark,janewangfb/spark,nilsgrabbert/spark,kissmetrics/spark,zhouyejoe/spark,sureshthalamati/spark,hvanhovell/spark,pgandhi999/spark,setjet/spark,narahari92/spark,Aegeaner/spark,spark-test/spark,srowen/spark,lvdongr/spark,maropu/spark,jkbradley/spark,panfengfeng/spark,shuangshuangwang/spark,jkbradley/spark,wzhfy/spark,brad-kaiser/spark,poffuomo/spark,srowen/spark,ron8hu/spark,panfengfeng/spark,UndeadBaneGitHub/spark,ConeyLiu/spark,nlalevee/spark,bOOm-X/spark,skonto/spark,huang1900/spark,mahak/spark,someorz/spark,esi-mineset/spark,ueshin/apache-spark,mike0sv/spark,kiszk/spark,markhamstra/spark,szhem/spark,skonto/spark,saturday-shi/spark,jlopezmalla/spark,milliman/spark,byakuinss/spark,shaneknapp/spark,kissmetrics/spark,MLnick/spark,rikima/spark,zhouyejoe/spark,ericvandenbergfb/spark,BryanCutler/spark,zzcclp/spark,UndeadBaneGitHub/spark,ahnqirage/spark,andrewor14/spark,WeichenXu123/spark,hvanhovell/spark,debugger87/spark,gengliangwang/spark,aokolnychyi/spark,ajaysaini725/spark,goldmedal/spark,akopich/spark,stanzhai/spark,guoxiaolongzte/spark,techaddict/spark,witgo/spark,ueshin/apache-spark,dbtsai/spark,janewangfb/spark,wangmiao1981/spark,janewangfb/spark,ajaysaini725/spark,setjet/spark,jianran/spark,liutang123/spark,minixalpha/spark,apache-spark-on-k8s/spark,BryanCutler/spark,spark-test/spark,kissmetrics/spark,michalsenkyr/spark,zero323/spark,akopich/spark,nchammas/spark,hhbyyh/spark,hvanhovell/spark,spark-test/spark,HyukjinKwon/spark,minixalpha/spark,vinodkc/spark,tejasapatil/spark,lxsmnv/spark,narahari92/spark,vinodkc/spark,esi-mineset/spark,techaddict/spark,guoxiaolongzte/spark,rikima/spark,ptkool/spark,bdrillard/spark,szhem/spark,saltstar/spark,yanboliang/spark,adrian-ionescu/apache-spark,joseph-torres/spark,icexelloss/spark,ddna1021/spark,1haodian/spark,jkbradley/spark,hvanhovell/spark,publicRoman/spark,wangmiao1981/spark,BryanCutler/spark,mzl9039/spark,caneGuy/spark,jiangxb1987/spark,mike0sv/spark,maropu/spark,shubhamchopra/spark,esi-mineset/spark,ioana-delaney/spark,shuangshuangwang/spark,tejasapatil/spark,stanzhai/spark,BryanCutler/spark,jianran/spark,andrewor14/spark,wangyum/spark,shubhamchopra/spark,1haodian/spark,BryanCutler/spark,spark-test/spark,MLnick/spark,jiangxb1987/spark,loneknightpy/spark,Aegeaner/spark,liutang123/spark,skonto/spark,WindCanDie/spark,dhruve/spark,panfengfeng/spark,rednaxelafx/apache-spark,darionyaphet/spark,nlalevee/spark,sachintyagi22/spark,guoxiaolongzte/spark,poffuomo/spark,saltstar/spark,adrian-ionescu/apache-spark,michalsenkyr/spark,kevinyu98/spark,caneGuy/spark,facaiy/spark,MLnick/spark,map222/spark,facaiy/spark,adrian-ionescu/apache-spark,lvdongr/spark,WeichenXu123/spark,ron8hu/spark,tejasapatil/spark,actuaryzhang/spark,someorz/spark,mdespriee/spark,markhamstra/spark,markhamstra/spark,zero323/spark,JoshRosen/spark,ahnqirage/spark,esi-mineset/spark,hhbyyh/spark,ConeyLiu/spark,sureshthalamati/spark,chuckchen/spark,mzl9039/spark,ericvandenbergfb/spark,cin/spark,BryanCutler/spark,shubhamchopra/spark,ddna1021/spark,JerryLead/spark,tejasapatil/spark,gengliangwang/spark,milliman/spark,aokolnychyi/spark,sahilTakiar/spark,pgandhi999/spark,yanboliang/spark,aokolnychyi/spark,bOOm-X/spark,dongjoon-hyun/spark,cloud-fan/spark,nchammas/spark,andrewor14/spark,eyalfa/spark,shuangshuangwang/spark,HyukjinKwon/spark,dhruve/spark,nchammas/spark,UndeadBaneGitHub/spark,apache-spark-on-k8s/spark,xflin/spark,yanboliang/spark,zhouyejoe/spark,SHASHANKB/spark,zzcclp/spark,skonto/spark,mzl9039/spark,andrewor14/spark,nilsgrabbert/spark,minixalpha/spark,zhouyejoe/spark,brad-kaiser/spark,minixalpha/spark,tengpeng/spark,joseph-torres/spark,narahari92/spark,WeichenXu123/spark,jlopezmalla/spark,witgo/spark,huang1900/spark,shuangshuangwang/spark,jrshust/spark,yanboliang/spark,jlopezmalla/spark,jianran/spark,darionyaphet/spark,shaneknapp/spark,pgandhi999/spark,saturday-shi/spark,JerryLead/spark,ajaysaini725/spark,wangmiao1981/spark,ConeyLiu/spark,andrewor14/spark,taroplus/spark,markhamstra/spark,jrshust/spark,jlopezmalla/spark,kevinyu98/spark,aray/spark,aray/spark,lxsmnv/spark,tengpeng/spark,joseph-torres/spark,saltstar/spark,bdrillard/spark,wangmiao1981/spark,apache/spark,WindCanDie/spark,michalsenkyr/spark,nchammas/spark,wangyum/spark,xuanyuanking/spark,byakuinss/spark,someorz/spark,vinodkc/spark,dbtsai/spark,ahnqirage/spark,brad-kaiser/spark,caneGuy/spark,eyalfa/spark,1haodian/spark,bravo-zhang/spark,alunarbeach/spark,1haodian/spark,sahilTakiar/spark,taroplus/spark,LantaoJin/spark,MLnick/spark,eyalfa/spark,cloud-fan/spark,aokolnychyi/spark,JoshRosen/spark,witgo/spark,saturday-shi/spark,apache-spark-on-k8s/spark,witgo/spark,aokolnychyi/spark,aosagie/spark,debugger87/spark,icexelloss/spark,JerryLead/spark,ioana-delaney/spark,Aegeaner/spark,map222/spark,holdenk/spark,caneGuy/spark