In most of the interviews this is one of the first interview questions that you might be asked for. By asking this question, interviewer will try to see if you can write even a simple logic through program.
And if you fail to write even this simple function, it means that you need to practice a lot and need to start learning Java from scratch.
In this video you will learn how to swap two numbers by writing a function in Java programing.
Learn Complete Basics of Java -
https://www.youtube.com/watch?v=IAmrocwsG04&list=PLsCNyqG0Gn3A96VsMFmyoP6qpikxwaNeK
Learn Intermediate Level Concepts of Java -
https://www.youtube.com/watch?v=gyOinrnIVGs&list=PLsCNyqG0Gn3A9W4NzNMYtKYJ51_ET8hRX
Learn Complete Test Automation with Java + Selenium -
https://www.youtube.com/watch?v=fnhAnMkQKVo&list=PLsCNyqG0Gn3DdS8nx0vZ6kt1mWC286olU
Learn Java through Interview Questions -
https://www.youtube.com/watch?v=HwIoz4GB1uc&list=PLsCNyqG0Gn3DVP8eKpfiLntxutxweM_j6
Learn Java Programming through Interview Questions Speed Code -
https://www.youtube.com/watch?v=k932eK8P-Zk&list=PLsCNyqG0Gn3BJATFOp13Vd6-USwBt6jMb
Do's and Dont's in Interviews
https://www.youtube.com/watch?v=GEzfpk5nNUI&list=PLsCNyqG0Gn3DCzrvIC8BSNAChPuXkPbzS
Learn Test Automation tool Oracle Applications Testing Tool ( OATS - Functional Test Automation)-
https://www.youtube.com/watch?v=dCf8J2SZ-hg&list=PLsCNyqG0Gn3CfBug1mmcvFpKVJzlIrzyS