logo Sign In

ricarleite

User Group
Members
Join date
9-Apr-2004
Last activity
11-Sep-2025
Posts
6,594

Post History

Post
#52375
Topic
Code Wars: Return of the java
Time
Quote

Originally posted by: Shimraa
yous could just use switch couldnt you.


No, you can't use comparison of any kind. Some people tried to cheat by transforming a while statement into an if:

if(boolvar){
dostuff();
}

into

temp = true
while(boolvar && temp){
dostuff();
temp = false;
}

You can't do that either.

And Hal 9000, what kind of programing language is that? The binary language of a moister vaporator? Bocce? A primitive dialect from Endor moons?
Post
#52260
Topic
Lucas to give the Oscars back to the Academy
Time
Oh, but I didn't want to work with this anyway... Computers, and programing, and coffee adiction, it's dull, and depressing... I've always wanted to be...

...a lumberjack! Leaping from tree to tree as they float down the mighty rivers of British Columbia! The smell of fresh cut timber! The giant redwood! The larch! The fir! The mighty Scots pine! With my best girlie by my side, we'd sing... sing... sing!
Post
#52249
Topic
Code Wars: Return of the java
Time
Quote

Originally posted by: Shimraa
what the null pointer bit again.


If that variable wasn't declared anywhere, then the compiler itself would stop and complain about this. If it has been declared, but not set any value, two things could happen: the compiler could get that thet variable was null and complain, or I belive it would throw a nullPointerException, since that variable is pointing to an unlocated memory area.

It has been a while since I've stoped programing in Java, so, I might be wrong on the exception thrown.

Here's a challenge for you: create a function in any coding that gets 3 numbers and orders then, but without using IF.
Post
#52183
Topic
MORE CHANGES!!! (for the 2004 OT DVD release)
Time
Quote

Originally posted by: shanep
Re-read my post Bossk. I said it was never released. It was offered for order with the firing jetpack on the blister packs for Star Wars figures. The BG toys did have firing missiles and one family sued the maker when their kid shot himself in the eye with a Viper missile.


LOL...

Didn't the toy company expect this? Kids hurting their eyes with toy missles? I bet they did some research on how much profit they would make with the missle-firing toy (A), how much profit from a non-missle firing toy (B), and the amount of money spent off-court settlement with these cases (C). They figured it out that A-B > C, so they released with a missle anyway.
Post
#52178
Topic
Regan dead at 93
Time
Freaky... I was talking about Ronald Reagan, the actor-president, with some people this week, and even posted his name here a few hours before his death.

And the surviving ex-american presidents are:

Gerald Ford - he's about 90 years old now, and his last name is a car company.
Jimmy Carter - the nobel prize man, and responsible for the 1980 olimpic games boycott. He's about... 75 now? He's creepy.
George Bush - Daddy! The oil senior man!
Bill Clinton - now THAT's a man who had fun at the office.
Post
#52177
Topic
Code Wars: Return of the java
Time
Well, this method (called *****, which the compiler will not accept) will:

Call a resetDataBase void method, with no arguments. I asume it... resets the data base.

Create a new TextInputFile class, passing the file name as argument, and I asume it has all the bufferedwriter classes inside it.

While we didn't reach the end of the input file (btw it should be an OUTPUT file, you're READING it)...
...read a whole bunch of strings, each of these in a separated line.
...create a Character class passing an incorrect number of arguments (the lines read), which would throw an exception, BUT... I'll assume you overrided that constructor and created one of your own.
... and you insert this Character object by caling an unespecified "insertSingleChar" method, I'm not sure what it does.

Then you close the file, good call my young padawan.

If the integer variable numChar is bigger than zero, the method will return true. Unfortunally this will throw an nullPointerExecption, as this variable was not declared, alocated, and was never incremented. I'm assuming it's global, for some creepy reason.

Else... it returns false.

Ok, it's a method that's supposed to read a file and save it into a database, and if it reads nothing, it returns false, returning true otherwise. Unfortunally, for the reasons I have mentioned above, it wont work.


I'll post a link about how to make obscure, confusing code so that no one knows what's supposed to do, and no one can change it. It's hilarious, for those who know how to program.