01:40Learn VARARGS in 6 minutes! 💬
From the creator
#java #javatutorial #javacourse public class Main { public static void main(String[] args){ // varargs = allow a method to accept a varying # of arguments // makes methods more flexible, no need for overloaded methods // java will pack the arguments into an array // ... (ellipsis) System.out.println(average(1, 2, 3, 4)); } static double average(double... numbers){ double sum = 0; if(numbers.length == 0){ return 0; } for(double number : numbers){ sum += number; } return sum / numbers.length; } }
Published 2024-12-05 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.
Keep exploring Learn to Code
01:40
19:55Announcing General Availability of Azure Bot Service and Language Understanding service
Microsoft Developer
57:29
09:02
18:59
12:24How to provisioning IoT devices at scale with IoT Hub Device Provisioning Service
Microsoft Developer
14:41TWC9: Connect(); On-Demand, Dev’s Guide to Azure, Future Workspace, Furby Hacking and more...
Microsoft Developer