Java Var args Method - Case - 2 and Case - 3 (Part - 5)

Pubblicato il: 05 ottobre 2018
sul canale di: VK Programming Villa
1,055
16

In this tutorial we’re going to look at Var args method Syntax loopholes for OCJP Exam with Case – 2 and Case – 3 in Java programming language in detail and in Case – 2, we are going to learn some Legal Var arg method declarations with small code snippets and discuss how It is legal to have other parameters in a method that uses a var args and in Case – 3, we are going to learn some Legal / Illegal Var args method declarations with small-small code snippets.

Rule for Var args Parameters:
Var arg parameter must be the last parameter in the method’s signature.

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 – 4 i.e. we can’t declare more than one var arg parameters inside a var args method.

#java #Varargs #OCJP #SCJP #OCJPExam #SCJPExam #SyntaxLoopholes #Vararg #Programming #Tutorials #Case2 #Case3

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

FACEBOOK:   / cse.programming.assignments  

GOOGLE+ : https://plus.google.com/u/0/114693282...

Quora: https://www.quora.com/profile/Vinay-K...

Related Videos:    • OCJP-SCJP Exam / Java Interview Preparation  

Gmail: cse.programming.assignments@gmail.com


In questa pagina del sito puoi guardare il video online Java Var args Method - Case - 2 and Case - 3 (Part - 5) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato VK Programming Villa 05 ottobre 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,055 volte e gli è piaciuto 16 spettatori. Buona visione!