• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is String...  RSS feed

 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just ran across this method signature in some in-house code:

public JobSelect(String busCtrId, String deptId, String... excludeJobs)

What is that "String..."? I've never seen that syntax and Google doesn't seem to know how to search for it.
 
Ramesh Pramuditha Rathnayake
Ranch Hand
Posts: 178
2
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is called variable type argument(var-arg).


For more click here..

 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The String... here is a "varargs" argument, meaning you can pass in an array (of Strings) or a sequence of String arguments. Also varargs must be the last argument of a method.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of you. Interesting that I've been doing this for about 6 years now and never encountered that.
 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting that I've been doing this for about 6 years now and never encountered that.


"Varargs" were introduced with Java 1.5, and that was released in 2004.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've only been doing this since 2007 and the first 2 years I was limited to 1.4.

So that's my excuse....
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:I've only been doing this since 2007 and the first 2 years I was limited to 1.4.

Don't apologise. I went from 1.4.2 to 1.6 directly - like a lot of people, I suspect.

And I waited for several releases of 1.7 after the nasty headlines before I installed it - "bleeding"-edge is aptly named. But in future you might want to think about changing before they announce "end-of-life".

Winston
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We still haven't gone to 1.7 and have no immediate plans to do so. I can't even use HTML5 because we have hundreds of thin clients that are stuck on XP and Firefox 3.6 (yes, you read that right). They don't have enough memory on them to upgrade to a browser that supports HTML5.

Maybe sometime before I retire I'll get to use HTML5 and CSS3...

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!