[Question]
  [
Write a script that writes to standard output, or your language's equivalent, 100 lines of (valid) Java code that begins with:
```
class Tuple1 {public Object _0;}
class Tuple2 {public Object _0,_1;}
class Tuple3 {public Object _0,_1,_2;}
class Tuple4 {public Object _0,_1,_2,_3;}
class Tuple5 {public Object _0,_1,_2,_3,_4;}
class Tuple6 {public Object _0,_1,_2,_3,_4,_5;}
class Tuple7 {public Object _0,_1,_2,_3,_4,_5,_6;}
class Tuple8 {public Object _0,_1,_2,_3,_4,_5,_6,_7;}
class Tuple9 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8;}
class Tuple10 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8,_9;}
class Tuple11 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10;}
class Tuple12 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11;}
```
The last line should begin with `class Tuple100`.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins!
  
[Answer]
# vim ~~56~~ 54 keystrokes
```
iclass Tuple1 {public Object _0;}<esc>qyYp<C-a>$y2bPr,<C-a>q98@y
```
Since V is backwards compatible, you can [Try it online!](https://tio.run/##K/v/PzM5J7G4WCGktCAn1VChuqA0KSczWcE/KSs1uUQh3sC61ia1ONmusDKywMZZN9FOpdIoKaBIB8wutLRwqPz//79uGQA "V – Try It Online")
This is the perfect task for vim! I might golf it a little bit more later. Also note that `<c-a>` means Control-A, and it counts as one keystroke.
Explanation:
```
iclass Tuple1 {public Object _0;}<esc>         'Enter the starting text
qy                          'Start recording in register y
  Yp                        'Yank the current line, the print on the line below
     <C-a>                  'Increment the next digit to occur by one
          $                 'Move to the end of this line
           y2b              '(yank) 2 words (b)ack. This will grab '_0;'
              P             'Print the previously yanked word before the cursor.
               r,           '(r)eplace the char under the cursor with a comma.
                 <c-a>q     'Increment the current digit, then stop recording
                       99@y 'Playback macro 'y' 99 times.
```
[Answer]
# Jelly, 44 bytes
```
R’j“,_”
“¤>%,oỊȤʠ“ØụĊ5D³ṃṠɼQ»j;Ç;“;}¶”
ȷ2RÇ€
```
My first Jelly answer. [Try it online!](http://jelly.tryitonline.net/#code=UuKAmWrigJwsX-KAnQrigJzCpD4lLG_hu4rIpMqg4oCcw5jhu6XEijVEwrPhuYPhuaDJvFHCu2o7w4c74oCcO33CtuKAnQrItzJSw4figqw&input=)
[Answer]
# Java, 160, 125 Bytes
Thanks to @DenkerAffe, @Denham Coote and @Mathias Ettinger for the improvements.
Java writing java( because someone had to!)
```
void z(){String s="_0";for(int i=1;i<101;){System.out.println("class Tuple"+(i++)+" {public Object "+s+";}");s+=",_"+i;}}
```
### And the un-golfed version
```
void z(){
    String s = "_0";
    for(int i = 1 ;i < 101;){
        System.out.println("class Tuple" + (i++) + " {public Object "+ s + ";}");
        s += ",_" + i;
        }
    }
```
[Answer]
# Jolf, 42 bytes
Do I get bonus points for beating Jelly with the best score ever? Contains unprintables, so you may want to try it [online here](http://conorobrien-foxx.github.io/Jolf/#code=wp_OnHp-MWQizp4vwojOryBUdXBsZSUge86eMMKMfyDOnjJRzrwgXyU7fSJIUnpIIixf). I replaced the unprintables with their respective alt index for readability.
```
‼Μz~1d"Ξ/êί Tuple% {Ξ0î⌂ Ξ2Qμ_ %;}"HRzH",_
```
## Explanation
```
‼Μz~1d"Ξ/êί Tuple% {Ξ0î⌂ Ξ2Qμ _%;}"HRzH",_
 Μz~1d                                     map the range 1..100 with the following function
      "                                    begin a string
       Ξ/êί                                short for "class"
            Tuple% {               H       string interpolate H (current number)
                    Ξ0î⌂ Ξ2Qμ              short for "public Object"
                              _%;}" RzH    string interpolate with a range from 1..H joined
                                       ",_  by the string ",_" (auto-closed quotes)
```
[Answer]
## Pyth, ~~53~~ ~~50~~ 48 bytes
```
VS100%." }SüÆðQ´Ó3Ô«%&a´4UçõÛ"[Nj",_"UN
```
[Try it online!](http://pyth.herokuapp.com/?code=VS100%25.%22+%7DS%C2%92%C3%BC%C3%86%C3%B0Q%C2%B4%C3%933%C3%94%10%C2%AB%25%07%C2%93%17%06%26%C2%89%19a%C2%B4%C2%9A4U%C3%A7%C3%B5%C3%9B%22%5BNj%22%2C_%22UN&debug=0)
Straightforward iteration over range(1,100) and building the corrosponding string from a packed string through formatting it.
## Explanation
```
VS100%." }SüÆðQ´Ó3Ô«%&a´4UçõÛ"[Nj",_"UN
VS100                                     # Iterate over range(1,100)
     %." }SüÆðQ´Ó3Ô«%&a´4UçõÛ"            # Unpack the string and format it
                              [           # List for formatting arguments
                               N          # Number of the Tuple
                                j    UN   # Join Object numbers...
                                 ",_"     # ...on the seperator ",_"
```
The unpacked string is `class Tuple%i {public Object _%s;}`
[Answer]
# CoffeeScript, ~~86~~ 84 bytes
```
console.log "class Tuple#{i} {public Object _#{[0...i].join ',_'};}"for i in[1..100]
```
[View the solution online](https://jsfiddle.net/1500535g/)
[Answer]
## Powershell - 65 bytes
(Amended in response to comment)
All credit to TimmyD
```
1..100|%{"class Tuple$_ {public Object _$(0..($_-1)-Join",_");}"}
```
[Answer]
# Oracle SQL 9.2, ~~138~~ 137 Bytes
```
SELECT REPLACE('class Tuple'||LEVEL||' {public Object'||SYS_CONNECT_BY_PATH(LEVEL-1,',_')||';}','t,','t ')FROM DUAL CONNECT BY LEVEL<101;
```
@Peter Thanks for pointing the 0/1 mistake.
The query use the CONNECT BY CLAUSE of hierarchical query to generate 100 rows.
The LEVEL pseudocolumn contains the row number of each row.
SYS\_CONNECT\_BY\_PATH concatenate the first parameter, the row number, of each row, and use the second parameter as the separator.
[Answer]
## Batch, 128 bytes
```
@set m=_0
@for /l %%t in (1,1,100)do @call:b %%t
@exit/b
:b
@echo class Tuple%1 {public Object %m%;}&set m=%m%,_%1
```
Edit: Saved 10 bytes thanks to @Bob. Saved 1 byte thanks to @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ.
[Answer]
## [Retina](https://github.com/mbuettner/retina/), ~~80~~ 79 bytes
Byte count assumes ISO 8859-1 encoding.
```
100$*1
1
class Tuple11$` {public Object 1$`}¶
1(?<= (1+))
_$1,
1(1)*
$#1
,}
;}
```
[Try it online!](http://retina.tryitonline.net/#code=CjEwMCQqMQoxCmNsYXNzIFR1cGxlMTEkYCB7cHVibGljIE9iamVjdCAxJGB9wrYKMSg_PD0gKDErKSkKXyQxLAoxKDEpKgokIzEKLH0KO30&input=)
[Answer]
# [Perl 6](http://perl6.org), 65 bytes
```
say "class Tuple$_ \{public Object _{join ',_',^$_};}" for 1..100
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 66 bytes
```
↑{∊'class Tuple'(⍕1+⍵)' {public Object _0'(',_'∘,∘⍕¨⍳⍵)';}'}¨0,⍳99
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qKM97f@jtonVjzq61JNzEouLFUJKC3JS1TUe9U411H7Uu1VTXaG6oDQpJzNZwT8pKzW5RCHeQF1DXSde/VHHDB0gBio8tOJR72awWuta9dpDKwx0gHxLS5Dp/9MA "APL (Dyalog Unicode) – Try It Online")
Explanation:
```
↑{∊'class Tuple'(⍕1+⍵)' {public Object _0'(',_'∘,∘⍕¨⍳⍵)';}'}¨0,⍳99
                                                             0,⍳99⍝ Numbers 0-99
                                                            ¨     ⍝ map to dfn
↑                                                                 ⍝ mix the result
  ∊'...'(⍕1+⍵)'...'                    ⍝ join the class header, tuple name (index + 1)
                                       ⍝ and the first tuple element.
                   (',_'∘,∘⍕¨⍳⍵)       ⍝ numbers from 1 to ⍵ prepended with ',_'
                                ';}'   ⍝ finish the class declaration
```
[Answer]
# R - ~~199~~ ~~132~~ ~~123~~ 118 bytes
Version 4
```
p=paste0;for(i in 1:10)cat(p("class Tuple",i," {public Object ",toString(sapply(0:(i-1),function(x)p("_",x))),";}\n"))
```
Version 3
```
p=paste0;for(i in 1:8)cat(p("class Tuple",i," {public Object ",p(sapply(0:(i-1),function(x)p("_",x)),collapse=","),";}\n"))
```
Version 2
```
p=paste0;for(i in 1:100)cat(p("class Tuple",i," {public Object ",p(sapply(0:(i-1),function(x)p("_",x)),collapse=","),";}"),sep="\n")
```
Version 1
```
for (i in 1:100){
  foo <- paste0("class Tuple", i, " {public Object ")
  for (j in 0:(i - 1)){
    foo <- if (j < (i - 1)) paste0(foo, "_", j, ",") else paste0(foo, "_", j, ";}")
  }
  print(foo)
}
```
[Answer]
# Ruby, 71 bytes
```
100.times{|i|puts"class Tuple#{i+1} {public Object _#{[*0..i]*',_'};}"}
```
[Answer]
# Java, 103 bytes
```
s->{s="_0";for(int i=0;i++<100;s+=",_"+i)System.out.printf("class Tuple%s {public Object %s;}\n",i,s);}
```
My first time here. Hi there! I went for a Java8 lambda expression (aka an anonymous function).
## Ungolfed version
```
s -> {
    s = "_0";
    for (int i = 0; i++ < 100; s += ",_" + i)
        System.out.printf("class Tuple%s {public Object %s;}\n", i, s);
}
```
To actually use this, as usual in Java8, you have to assign it to a variable of (or cast it to) an appropriate functional interface and then call its method; but technically, the function is only the lambda expression itself, so I am counting only that.
It also requires an input parameter, which saves me a couple bytes, since I can abuse it as a local variable without having to specify its type. I'm not sure if that's considered cheating, but to me it appears to be within the rules: I only saw people state that posting a function is allowed, not *how* that function needs to be invoked. :) And it doesn't actually read the parameter, so the function is still self-contained; you can pass any String to it, or even null, and it will still produce the correct output.
## And here is how to use it:
```
import java.util.function.Consumer;
public class Main {
    public static void main(String[] args) {
        Consumer<?> r =
            s->{s="_0";for(int i=0;i++<100;s+=",_"+i)System.out.printf("class Tuple%s {public Object %s;}\n",i,s);}
        ;
        r.accept(null); 
    }
}
```
[Answer]
# Python 2, 96
```
def f(n=99):s=n and f(n-1)+',_'+`n`or"class Tuple%d {public Object _0";print s%-~n+';}';return s
```
# Python 3, 98
```
def f(n=99):s=n and f(n-1)+',_%d'%n or"class Tuple%d {public Object _0";print(s%-~n+';}');return s
```
**Usage:**
```
f()
```
**Ungolfed:**
```
def javatuple(n=99):
    if n == 0:
        s = "class Tuple%d {public Object _0"
    else:
        s = javatuple(n-1) + ',_' + str(n)
    print(s%(n+1) + ';}')
    return s
```
**formers:**
**103**
```
r=range
for i in r(100):
 print"class Tuple%d {public Object _%s;}"%(i+1,',_'.join(`j`for j in r(i+1)))
```
**108**
```
def f(n=99):
 if n:f(n-1)
 print"class Tuple%d {public Object _%s;}"%(n+1,',_'.join(`i`for i in range(n+1)))
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 63 bytes
```
1..100|%{"class Tuple$_ {public Object _$(0..--$_-Join",_");}"}
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/31BPz9DAoEa1Wik5J7G4WCGktCAnVSVeobqgNCknM1nBPykrNblEIV5Fw0BPT1dXJV7XKz8zT0knXknTulap9v9/AA "PowerShell – Try It Online")
Two byte improvement of [bulletprooffool's answer](https://codegolf.stackexchange.com/a/70915/78849), who seems to be an abandoned account now.
[Answer]
# CJam, 53 bytes
```
100{)"class Tuple"\" {public Object _"1$,",_"*";}
"}/
```
[Try it here](http://cjam.aditsu.net/#code=100%7B)%22class%20Tuple%22%5C%22%20%7Bpublic%20Object%20_%221%24%2C%22%2C_%22*%22%3B%7D%0A%22%7D%2F).
[Answer]
# Groovy, 74 chars
"join()" is unbeatable... New solution, thanks to @yariash
```
100.times{println"class Tuple$it {public Object _${(0..it-1).join',_'};}"}
```
Old solution, 78 chars:
```
(1..100).each{println"class Tuple$it {public Object _${(0..it-1).join',_'};}"}
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 43 bytes
```
тFNÝ„,_ý'_ì'Œº™'‚ÆN>'„à"ÿ Tupleÿ {ÿ ÿ ÿ;}"=
```
[Try it online!](https://tio.run/##yy9OTMpM/f//YpOb3@G5jxrm6cQf3qsef3iN@tFJh3Y9almk/qhh1uE2PzsgPe/wAqXD@xVCSgtyUoF0NRCDkXWtku3//wA "05AB1E – Try It Online")
[Answer]
# FALSE, 85 bytes
```
1[$100>~][$$0"class Tuple"\." {public Object "[$@$@=~][\$0>[","]?$"_".1+]#";}
"%%1+]#
```
[Try it online!](https://tio.run/##S0vMKU79/98wWsXQwMCuLjZaRcVAKTknsbhYIaS0ICdVKUZPSaG6oDQpJzNZwT8pKzW5REEpWsVBxcEWqDhGxcAuWklHKdZeRSleSc9QO1ZZybqWS0lVFcT8/x8A)
Loops through 1-100 to get the Tuple number and then within that loops from 0 to currnum-1 to get underscores.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 36 bytes
```
`⟑↓ Tuɖ¾% {ƛḊ ß₂ %;}`₁ƛɾ\_$+\,j";v%⁋
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCJg4p+R4oaTIFR1yZbCviUge8ab4biKIMOf4oKCICU7fWDigoHGm8m+XFxfJCtcXCxqXCI7diXigYsiLCIiLCJbOSwgNywgLTEsIDYsIDUsIDIsIDExLCAxNiwgMjddIl0=)
```
     ₁ƛ         ;    # map 1...100 to...
       ɾ             # 1...n
        \_$+         # Prepend underscores to each
            \,j      # Join by commas
               "     # Pair with n
`...`                # Compressed string `class Tuple% {public object %;}`
                 v%  # Formatted with (n, names)
                   ⁋ # Join by newlines
```
[Answer]
# Julia, 77 bytes
```
for i=1:100;println("class Tuple$i {public Object _$(join(0:i-1,",_"));}")end
```
[Answer]
# Lua, ~~128~~ 106 Bytes
I'm still trying to find a way to directly work on a printed value, and not on a string.
**Edit : Partially found it! I still need a string for the "\_0,\_1..." part, but it already is better :).**
```
s=""for i=0,99 do s=(s..",_"..i):gsub("^,",s)print(("class Tuple"..(i+1).." {public Object ")..s..";}")end
```
### Old 128 Bytes solution
```
s="class Tuple1 {public Object _0;}"print(s)for i=1,99 do s=s:sub(1,s:find";"-1):gsub("e%d+","e"..i+1)..",_"..i..";}"print(s)end
```
### Ungolfed
```
s=""
for i=0,99
do
  s=(s..",_"..i)              -- concatenate s with ",_i"
      :gsub("^,",s)           -- remove the leading "," for ",_0"
  -- then print the concatenated string
  print(("class Tuple"..(i+1).." {public Object ")..s..";}")
end
```
[Answer]
# Python 3, 111 109 105 bytes
```
[print('class Tuple%s {public Object %s;}'%(i,','.join('_%i'%j for j in range(i))))for i in range(1,101)]
```
It's not the shortest thing in the world, I'm just participating.
edit1: down 2 bytes by removing `0,` in first `range`
edit2: I was unnecessarily casting `int` to `str` instead of just using `%i`... Down to 105.
[Answer]
# Mathematica, 130 Bytes
```
{"class Tuple",ToString[#]," {public Object ",StringReplace[ToString[#-1&/@Range@#],{" "|"{" ->"_","}"->";}\n"}]}&/@Range[100]<>""
```
[Answer]
# Scala, 85 Bytes
```
for(u<-1 to 100)println(s"class Tuple$u {public Object _${0 to u-1 mkString ",_"};}")
```
[Answer]
## Java, 116
(for the printing function only - according to some comments, this is in line with the rules)
```
import static java.lang.System.*;
public class T
{
    public static void main(String[] args)
    {
        T t = new T();
        t.p();
    }
    void p(){String s="_0";for(int i=0;i<100;){out.println("class Tuple"+ ++i+" {public Object "+ s + ";}");s+=",_"+i;}}
}
```
[Answer]
## PHP, 112 bytes
```
<?php for($i=0;$i<100;$i++){$m.=$i==0?'_'.$i:',_'.$i;echo 'class Tuple'.($i+1).' {public Object '.$m.';}<br/>';}
```
[Answer]
## Seriously, 55 bytes
```
2╤R`;r"$'_+"£M',j@k"c╙ò T╒α%d {pu▐V Object %s;}"⌡%`M'
j
```
Hexdump (reversible with `xxd -r`):
```
00000000: 32e2 95a4 5260 3b72 2224 275f 2b22 c2a3  2...R`;r"$'_+"..
00000010: 4d27 2c6a 406b 2263 e295 99c3 b220 54e2  M',j@k"c..... T.
00000020: 9592 ceb1 2564 207b 7075 e296 9056 204f  ....%d {pu...V O
00000030: 626a 6563 7420 2573 3b7d 22e2 8ca1 2560  bject %s;}"...%`
00000040: 4d27 0a6a                                M'.j
```
[Try it online!](http://seriously.tryitonline.net/#code=MuKVpFJgO3IiJCdfKyLCo00nLGpAayJj4pWZw7IgVOKVks6xJWQge3B14paQViBPYmplY3QgJXM7fSLijKElYE0nCmo&input=)
Yes, that newline is supposed to be there.
Explanation (newline replaced with `\n`):
```
2╤R`;r"$'_+"£M',j@k"c╙ò T╒α%d {pu▐V Object %s;}"⌡%`M'\nj
2╤R                                                       push range [1,100]
   `                                              `M      map:
    ;r                                                      push a, range(a)
      "$'_+"£M                                              map:
       $'_+                                                   stringify, prepend "_"
              ',j                                           join with commas
                 @k                                         swap and push stack as list
                   "c╙ò T╒α%d {pu▐V Object %s;}"⌡           decompress, result is
                                                              "class Tuple%d {public Object %s;}"
                                                 %          string format
                                                    '\nj  join with newlines
```
]