Help with Java programming

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Help with Java programming

Postposted on Sat Jan 24, 2009 6:47 am

Is anyone here really good with Java or has experience with BlueJ?
Core i5 2500k @ 4Ghz | MSI 6950 Twin Frozr III | 8Gb DDR3 1600Mhz | ASUS Z68 Pro | 1200W Thermaltake Toughpower | OCZ Lian Li V2010b | HP LP2475w
mjallan123
Gerbil First Class
 
Posts: 160
Joined: Fri Jan 19, 2007 11:08 am
Location: Scotland

Re: Help with Java programming

Postposted on Sat Jan 24, 2009 10:38 pm

I may be able to help with the Java part; never used BlueJ though. You'll probably also get more responses if you post the actual problem you're having.
2600K @ 4.8GHz; XSPC Rasa/RX240/RX120 Phobya Xtreme 200; Asus P8Z68-V Pro; 16GB Corsair Vengeance 1333 C9; 2x7970 OC w/ Razor 7970; Force GT 120GB; 3x F3 1TB; Corsair HX750; X-Fi Titanium; Corsair Obsidian 650D; Dell 2408WFP Rev. A01; 2x Dell U2412m
mortifiedPenguin
Gerbil Elite
 
Posts: 812
Joined: Mon Oct 08, 2007 6:46 pm

Re: Help with Java programming

Postposted on Mon Jan 26, 2009 7:45 am

1. Which of the following is a correct Java assignment statement (assuming k has been correctly defined)?
(a) k = 3; (b) 3 = k; (c) k + 3; (d) k == 3;

2. What term is used for a set of Java classes, grouped into packages, that come bundled with the standard Java platform?
(a) CSL (b) SCC (c) PWP (d) API

3. What term is used to describe a fact that is always true for objects of a class?
(a)A class invarient (b) A pre-condition (c) A global variable (d) A post-condition

4. What is meant by the scope of a Java variable?
(a) Those Java instructions that refer to the variable
(b) Those parts of the Java program where it is legitimate to refer to the variable
(c) How much memory the variable takes up
(d) The length of time the variable exists

5. In a Java non-void method, what is the last instruction that must be obeyed?
(a) A stop instruction (b) A break instruction (c) A return instruction (d) A contine instruction

I will probably have more, but I would greatly appreciate any help.
Core i5 2500k @ 4Ghz | MSI 6950 Twin Frozr III | 8Gb DDR3 1600Mhz | ASUS Z68 Pro | 1200W Thermaltake Toughpower | OCZ Lian Li V2010b | HP LP2475w
mjallan123
Gerbil First Class
 
Posts: 160
Joined: Fri Jan 19, 2007 11:08 am
Location: Scotland

Re: Help with Java programming

Postposted on Mon Jan 26, 2009 7:53 am

So those look like you copied as pasted questions from your homework, you will not get any help for something like that.

Help on how to do something is one thing, just getting the answers is completely different.
tfp
Grand Gerbil Poohbah
 
Posts: 3066
Joined: Wed Sep 24, 2003 10:09 am

Re: Help with Java programming

Postposted on Mon Jan 26, 2009 7:57 am

Actually those questions are from a past paper for helping us revise for a test.

There is no answer sheet though, so I do not know if my answers are correct.
Core i5 2500k @ 4Ghz | MSI 6950 Twin Frozr III | 8Gb DDR3 1600Mhz | ASUS Z68 Pro | 1200W Thermaltake Toughpower | OCZ Lian Li V2010b | HP LP2475w
mjallan123
Gerbil First Class
 
Posts: 160
Joined: Fri Jan 19, 2007 11:08 am
Location: Scotland

Re: Help with Java programming

Postposted on Mon Jan 26, 2009 8:02 am

First of all, this probably isn't the right forum for these sort of questions. There are a lot of forums out there specifically designed to help people with programming homework.

For the first one try running all three of those lines through a compiler. If I understand Java then only one should be legal. (Define k first)

For the second one, search Wikipedia for all those terms. I looked for the one I thought it was and there was no question in my mind that it was right.

For the third one, just look at the words and which one makes sense with "always true for ... class". Or go back to Wikipedia.

For the fourth one, look at Wikipedia's article on scope.

For the fifth one, what's the last line of a function that isn't void?

Sorry, that I won't come right out and tell you the answers, but I managed to figure these all out in less than five minutes, so I'm sure you can do the same now that you know where to look. Plus, it's best to do your own homework. :wink:

I'd recommend finding a programming forum if you're going to need help debugging code. You'll probably get a better/faster response with that.
"TORTURIS EXUVIAS EUNT"
Phenom X6 1090T @ 3.2 GHz
Sapphire Radeon 6950
TurtlePerson2
Graphmaster Gerbil
 
Posts: 1097
Joined: Sat May 26, 2007 8:08 am
Location: Plano, Texas

Re: Help with Java programming

Postposted on Mon Jan 26, 2009 8:32 am

because i'm bored at work i will make an attempt (disclaimer: i work mainly in java but i'm only human :-)

1) (a)

2) (d) Odd question. It depends on *what* classes. I guess an API is the answer they want. This is not java-specific though.

3) (a)

4) (b) this is a rather simplified answer.

5) (c) strangely worded question, all instructions must be obeyed.
ztrand
Gerbil
 
Posts: 97
Joined: Sat Jun 24, 2006 6:54 am
Location: Europe

Re: Help with Java programming

Postposted on Mon Jan 26, 2009 4:04 pm

You may be bored, but I don't think you are helping by doing his homework instead of helping him find the answers on his own.
Image
The Model M is not for the faint of heart. You either like them or hate them.

Gerbils unite! Fold for UnitedGerbilNation, team 2630.
Flying Fox
Gerbil God
 
Posts: 24137
Joined: Mon May 24, 2004 1:19 am

Re: Help with Java programming

Postposted on Tue Jan 27, 2009 1:36 am

True but in my opinion it's up to him if he wants to be lazy. And I was very bored.
ztrand
Gerbil
 
Posts: 97
Joined: Sat Jun 24, 2006 6:54 am
Location: Europe

Re: Help with Java programming

Postposted on Tue Jan 27, 2009 7:33 am

ztrand wrote:True but in my opinion it's up to him if he wants to be lazy. And I was very bored.

You could have slipped a wrong answer in there if you are that bored. :P :lol:
Image
The Model M is not for the faint of heart. You either like them or hate them.

Gerbils unite! Fold for UnitedGerbilNation, team 2630.
Flying Fox
Gerbil God
 
Posts: 24137
Joined: Mon May 24, 2004 1:19 am


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 1 guest