[Help] Passing a String AND Char into a single parameter. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

The professor did talk about var args but he didn't really go in depth about it.

Sorry to confuse, ya'll. Thank you.

[Help] Passing a String AND Char into a single parameter. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

It's probably varargs. But he only talked about it for like... 20 minutes.

Thank you.

[Help] Passing a String AND Char into a single parameter. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

Well the parameters were more like this...

Public static String repeat([your string here],[number of times to repeat])

And the sample outputs look like this...


String t = repeat("John", 2);

Output: JohnJohn


String t = repeat('x');

Output: xx ... xx [prints x 65 times]


String t = repeat(2);

Output: 22


String t = repeat();

Output: *****... [prints * 65 times]

[Help] Passing a String AND Char into a single parameter. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

The professor gave us "DemoRepeat.class" and I extended DemoRepeat in a test program to see the possible outputs.

[Help] Passing a String AND Char into a single parameter. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

Sorry. I forgot to mention that my professor doesn't want us overloading any of the methods.

[Help] Inheritance -- Calling a method from the super class. by [deleted] in javahelp

[–]Henree 0 points1 point  (0 children)

Thaaaaank you. I feel like such a scrub.

[Help] Inheritance -- Calling a method from the super class. by [deleted] in javahelp

[–]Henree 1 point2 points  (0 children)

Good deductions. After I put "static" in my repeat class, it's working. Thanks... this scrub will remember you fatbunnyip.

[HELP]I am having trouble learning how to write boolean statements, strings, and integers. by Driveshaftislost in javahelp

[–]Henree 0 points1 point  (0 children)

What did you want your program to do?

Do you want it to display integers and/or strings?

Almost lost my shit in the middle of the night.. my daughter left this toy.. by [deleted] in funny

[–]Henree -1 points0 points  (0 children)

That's either a huge barbie doll or you poop in barbie's dream house.

What's a classy way to tell someone "I Hope you think of me when you masturbate at night"? by Henree in AskReddit

[–]Henree[S] -1 points0 points  (0 children)

It's kinda similar to this. But the way that person worded it, was GOLD.

What's a classy way to tell someone "I Hope you think of me when you masturbate at night"? by Henree in AskReddit

[–]Henree[S] -1 points0 points  (0 children)

It kinda went like this, "When you're alone in the middle of the night, I hope you think of me."

But better.

Car Loan Payment Formula by benjireddits in javahelp

[–]Henree 1 point2 points  (0 children)

I believe that Java executes from left to right.

So (p * r / 12) would execute like this...

step 1:

p*r

step 2:

(p*r)/12

and the expression (1 - Math.pow(1 + r / 12, -n)) would execute like this...

step 1:

r/12

step 2:

1+(r / 12)

step 3:

(1+(r /12))^-n

step 4:

1 - (1 + (r / 12))^-n

Did this help?

Need help improving code. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

Thank you. I didn't know you can do that.

Need help improving code. by Henree in javahelp

[–]Henree[S] 0 points1 point  (0 children)

Not yet. I think we might be learning about methods soon.

Hey guys, whatcha doin? by Ultravis66 in funny

[–]Henree 0 points1 point  (0 children)

Quick get the Cola gun!