Java Var args Method - Case - 4 (Part - 6)

preview_player
Показать описание
In this tutorial we’re going to look at Var args method Syntax loopholes for OCJP Exam with Case – 4 in Java programming language in detail and in Case – 4, we are going to learn some illegal Var arg method declarations with small code snippets and discuss how It is illegal to declare more than one var args parameters inside a var args method

Rule for Var args Parameters:

Var arg parameter must be the last parameter in the method’s signature and must declare only one var arg parameter inside a var args method.

Background :

Q: You may ask why we need var args Method. Where it is useful?

A: Let me explain you first, Problem until Java 4.0.

1. We cannot declare a method with variable number of arguments.

2. If there is a change in a number of arguments then compulsory we should declare a new method, which increases the length of code and reduces readability.

So, to overcome this problem “SUN” people introduced var-args method concept in Java 5.0 or jdk1.5 version that are explained it with programs. You must watch previous videos for problem understanding as well as for better understanding of Var args concept with solution.

Upcoming Video :

In our next tutorial, we will learn more about var arg method - Syntax Loopholes for OCJP Exam Case – 5 important points like Var args methods will get least priority i.e. if no other normal method matched then only var arg method will get the chance.

#java #Varargs #OCJP #SCJP #OCJPExam #SCJPExam #SyntaxLoopholes #Vararg #Programming #Tutorials #Case4

Social Links: Don't hesitate to contact me if you have any further questions.

Рекомендации по теме
Комментарии
Автор

Very nice concise, crisp and clear explaination of a Var-arg Method and its case 4

remotepc
Автор

Another Good Tutorial. worth to watch. Keep it up Sir. Thank You

kiranarora
Автор

Another good video. Thank you sir for such good knowledge

therealdangji
Автор

Learning some good concepts from you sir. keep upload more videos.

shikhasharma
Автор

All cases are well explained in previous videos. this one is also good. :) Thank you :)

inceptiontech