14 Guests viewing this page
Hidden 7 yrs ago Post by DarkwolfX37
Raw
GM
Avatar of DarkwolfX37

DarkwolfX37 Absolute L User

Member Seen 17 days ago

Dahv, could you help me out with something real quick?

What on Earth am I doing wrong with my method creation? Am I just missing something because I don't know of some other step(s) I need to do or what?


It's not as simple as a typo with "Scanner in" needing to be "Scanner.in" is it?
Hidden 7 yrs ago Post by Galaxy Raider
Raw
coGM
Avatar of Galaxy Raider

Galaxy Raider Kat

Member Seen 11 days ago

<Snipped quote by Galaxy Raider>

It's not as simple as a typo with "Scanner in" needing to be "Scanner.in" is it?


Nah. That isn't even an error actually. My only error is in Line 4, where I am trying to create a method. I get an error telling me that "void" is not a valid type for the variable "swapFunction".
Hidden 7 yrs ago 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

Dahv, could you help me out with something real quick?

What on Earth am I doing wrong with my method creation? Am I just missing something because I don't know of some other step(s) I need to do or what?


Your problem is that you're trying to put your Main in a separate class. You don't declare Class functions in Main; you declare them in the class itself and then call that Class' object (or static methods) from Main.

<Snipped quote by Galaxy Raider>

It's not as simple as a typo with "Scanner in" needing to be "Scanner.in" is it?


Nah, it uses System.in as a parameter to construct a Scanner object because it pulls from System input. Scanner.in would be pulling a parameter from its own static variable, in which case it could forgo using parameters altogether.

<Snipped quote by DarkwolfX37>

Nah. That isn't even an error actually. My only error is in Line 4, where I am trying to create a method. I get an error telling me that "void" is not a valid type for the variable "swapFunction".


It gives you that error because it thinks your function is a variable, since you can't declare functions in Main (though you can do this in JavaScript).

Also please import System. It makes it way easier.
And camelcase your variables.
Hidden 7 yrs ago Post by DarkwolfX37
Raw
GM
Avatar of DarkwolfX37

DarkwolfX37 Absolute L User

Member Seen 17 days ago

<Snipped quote by Galaxy Raider>

Your problem is that you're trying to put your Main in a separate class. You don't declare Class functions in Main; you declare them in the class itself and then call that Class' object (or static methods) from Main.

<Snipped quote by DarkwolfX37>

Nah, it uses System.in as a parameter to construct a Scanner object because it pulls from System input. Scanner.in would be pulling a parameter from its own static variable, in which case it could forgo using parameters altogether.

<Snipped quote by Galaxy Raider>

It gives you that error because it thinks your function is a variable, since you can't declare functions in Main (though you can do this in JavaScript).

Also please import System. It makes it way easier.
And camelcase your variables.


That does definitely make sense. Just wanted to make sure.

<Snipped quote by DarkwolfX37>

Nah. That isn't even an error actually. My only error is in Line 4, where I am trying to create a method. I get an error telling me that "void" is not a valid type for the variable "swapFunction".


Okay so in future maybe mention what line is the error and put your { as a seperate line unless CS doesn't let you do that. It looks better and is easier to parse mentally.
Hidden 7 yrs ago Post by Valiance
Raw
Avatar of Valiance

Valiance Roland

Member Seen 2 mos ago

<Snipped quote by Galaxy Raider>

Your problem is that you're trying to put your Main in a separate class. You don't declare Class functions in Main; you declare them in the class itself and then call that Class' object (or static methods) from Main.

<Snipped quote by DarkwolfX37>

Nah, it uses System.in as a parameter to construct a Scanner object because it pulls from System input. Scanner.in would be pulling a parameter from its own static variable, in which case it could forgo using parameters altogether.

<Snipped quote by Galaxy Raider>

It gives you that error because it thinks your function is a variable, since you can't declare functions in Main (though you can do this in JavaScript).

Also please import System. It makes it way easier.
And camelcase your variables.


I think I get what I need now. Lemme try it.

Also we're only allowed to use resources we've been given, and that doen't include importing system.

Also also, are they not already?

Also also also, thank you.
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

<Snipped quote by Host>

I think I get what I need now. Lemme try it.

Also we're only allowed to use resources we've been given, and that doen't include importing system.

Also also, are they not already?

Also also also, thank you.


Super not fair.

Camelcase makes the first letter of the variable lowercase. So you'd end up with v1 and v2, becauseAll ofYour variablesWouldLook likeThis1.

<Snipped quote by Host>

That does definitely make sense. Just wanted to make sure.

<Snipped quote by Galaxy Raider>

Okay so in future maybe mention what line is the error and put your { as a seperate line unless CS doesn't let you do that. It looks better and is easier to parse mentally.


Yeah, absolutely.

Technically that's a stylization thing, but putting the brace on its own line is the objectively superior style.
Hidden 7 yrs ago Post by DarkwolfX37
Raw
GM
Avatar of DarkwolfX37

DarkwolfX37 Absolute L User

Member Seen 17 days ago

"Time to teach jerusalem what happens when you cross jesus."
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

"Time to teach jerusalem what happens when you cross jesus."


You get a solar eclipse, an earthquake, and the souls of the dead rising from their graves.
Hidden 7 yrs ago Post by DarkwolfX37
Raw
GM
Avatar of DarkwolfX37

DarkwolfX37 Absolute L User

Member Seen 17 days ago

<Snipped quote by DarkwolfX37>

You get a solar eclipse, an earthquake, and the souls of the dead rising from their graves.


Not sure you got the joke but okay.
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

<Snipped quote by Host>

Not sure you got the joke but okay.


I got the joke but felt the need to be historically accurate.
Hidden 7 yrs ago Post by DarkwolfX37
Raw
GM
Avatar of DarkwolfX37

DarkwolfX37 Absolute L User

Member Seen 17 days ago

<Snipped quote by DarkwolfX37>

I got the joke but felt the need to be historically accurate.


Wrong timeline.
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

<Snipped quote by Host>

Wrong timeline.


Wrong worldline.

Also night.
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

Apologies for the delay. A Jehovah's Witness just tried to give me a rundown on how things aren't.
Hidden 7 yrs ago Post by Valiance
Raw
Avatar of Valiance

Valiance Roland

Member Seen 2 mos ago

Apologies for the delay. A Jehovah's Witness just tried to give me a rundown on how things aren't.


Mommaaaa~
Dave just killed a man~
There were some lies that the man said~
So he fixed the knowledge in his head~
Oooooo~
Hidden 7 yrs ago Post by Techspert
Raw
Avatar of Techspert

Techspert Star

Member Seen 17 days ago

<Snipped quote by Host>

Mommaaaa~
Dave just killed a man~
There were some lies that the man said~
So he fixed the knowledge in his head~
Oooooo~


Hello fiction my old friend~
I've come to correct you again~
Hidden 7 yrs ago Post by whizzball1
Raw
Avatar of whizzball1

whizzball1 Spirit

Member Seen 4 yrs ago

so I'm writing a snippet about spectre
and here's a line from it
"Maddie had affixed fluffy, puffy wool to rings on her fingers and at the end of her sleeves, so her touch was like that of a warm sheep, without the smell and immense distaste for humankind. Ruby instantly felt better."
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

so I'm writing a snippet about spectre
and here's a line from it
"Maddie had affixed fluffy, puffy wool to rings on her fingers and at the end of her sleeves, so her touch was like that of a warm sheep, without the smell and immense distaste for humankind. Ruby instantly felt better."


Sheep don't like people?
Hidden 7 yrs ago Post by whizzball1
Raw
Avatar of whizzball1

whizzball1 Spirit

Member Seen 4 yrs ago

<Snipped quote by whizzball1>

Sheep don't like people?


as I have learned from several people who actually had to take care of sheep for a good while
no
more accurately, they don't care about anything you do and will almost never obey you or listen to you
Hidden 7 yrs ago Post by Host
Raw
Avatar of Host

Host Noir

Member Seen 27 days ago

I was going to say something witty but then realized that I didn't have anything witty to say.
Hidden 7 yrs ago Post by whizzball1
Raw
Avatar of whizzball1

whizzball1 Spirit

Member Seen 4 yrs ago

I was going to say something witty but then realized that I didn't have anything witty to say.


that is something spectre would say
↑ Top
14 Guests viewing this page
© 2007-2024
BBCode Cheatsheet