lesser-equity

Magazine
Go Back   Computer Juice > Computer Software > General Software Chat

Register


 Default 

Java




Reply
 
Thread Tools
  #11  
Old 21st Jan 2008, 14:00
Donor Group
 
Default Java

right
done all that put it j creator and compiled it test works fine displays 4 but test 2 cannot find the int1 variable something is going wrong with the extension ?
__________________
Im not a Geek!, Im Educated! - www.FossForums.com
__________________

My System: Cewy's wonder macine

Processor(s):
intel core 2 quad q6600 @ 3.2Ghz
Motherboard:
asus p5q deluxe
RAM Memory:
4 gig ocz 1066mhz sli
Graphics Card(s):
nvidia evga 8800 ultra ko
Sound Card:
onboard
Hard Drive(s):
750 gig seagate, 32meg cache
Optical Drive(s):
3 asus dvd writers, lightscribe
Case / PSU:
lian-li armoursuite pc-p60
Cooling:
tuniq tower
Network / Internet:
dual gigabit lan ports
Monitor(s):
24" dell 2408wfp
Operating System(s):
winfail vista 64 | ubuntu/arch linux
  #12  
Old 21st Jan 2008, 14:05
Donor Group
 
Default Java

w00000000t it worked !!!!!!!!
ill look over it again and tell you what the problem was
__________________
Im not a Geek!, Im Educated! - www.FossForums.com
  #13  
Old 21st Jan 2008, 14:08
Donor Group
 
Default Java

i think it is either 2 things
the static int i didn't do that or because i put the
public static void main(String[] args){
before assigning a value to the variable
also just to refresh my memory what is a static variable, saves me breaking out my big book
__________________
Im not a Geek!, Im Educated! - www.FossForums.com
  #14  
Old 21st Jan 2008, 14:38
Donor Group
 
Default Java

(a) order of statements should not matter
(b) a static variable is common to all class instances. You cannot use anything other than static vars in your main cos it is static. Otherwise you can do:

package com.google.stuff;
public class Test{
int int1 = 2, int2 = 2;
public static void main(String[] args){
Test test=new Test();

System.out.println(test.int1 + test.int2);
}
}


package com.google.stuff;
public class Test2 extends Test{
int int2 = 3;
public static void main(String[] args){
Test2 test=new Test2();
System.out.println(test.int1 + test.int2);
}
}
__________________
I think I am a signature, therefore I exist!
I believe a higher being has me as a signature...

  #15  
Old 21st Jan 2008, 15:01
Donor Group
 
Default Java

ah right
cheers :D
__________________
Im not a Geek!, Im Educated! - www.FossForums.com
  #16  
Old 21st Jan 2008, 15:02
Donor Group
 
Default Java

Oh, and Java Creator has been replaced by Netbeans hasn't it?
__________________
I think I am a signature, therefore I exist!
I believe a higher being has me as a signature...

  #17  
Old 21st Jan 2008, 15:04
Donor Group
 
Default Java

im not sure there a few ide's i used net beans but i am using jcreator as the book im using uses that but i may switch over depending
i cant remember does netbeans have an interface editor
__________________
Im not a Geek!, Im Educated! - www.FossForums.com
  #18  
Old 21st Jan 2008, 18:14
Donor Group
 
Default Java

Quote:
Originally Posted by Cew27 View Post
well when i try create a subclass under the correct package i get a no class defound error ill go into detail later
More detail im confused already


CG
__________________
"Dream as if you'll live forever, Live as if you'll die today"
__________________

My System: Puter

Processor(s):
Intel Quad Core Q6600
Motherboard:
Abit IN9
RAM Memory:
2x 1GB Patriot
Graphics Card(s):
XFX 8800GTS 320MB
Sound Card:
Hard Drive(s):
750GB Internal, 400GB External
Optical Drive(s):
LG 20x DVD re-writer
Case / PSU:
Enermax Infiniti 650W
Cooling:
Zalman HSF
Network / Internet:
Monitor(s):
LG 19" LCD
Operating System(s):
Windows XP Media Centre 2005
  #19  
Old 21st Jan 2008, 18:27
Banned Group
 
Default Java

and you say i spam alot
__________________

My System: #

Processor(s):
intel p4
Motherboard:
ecs 915pla2
RAM Memory:
1gb
Graphics Card(s):
ati radeon x1050
Sound Card:
diamond xtreme 7.1
Hard Drive(s):
160gb
Optical Drive(s):
dvd-rom combo drive dvd+/-rw
Case / PSU:
antech/x-power585
Cooling:
air
Network / Internet:
wireless
Monitor(s):
philips 109b6 19" CRT
Operating System(s):
windows xp
  #20  
Old 21st Jan 2008, 18:34
Donor Group
 
Default Java

Who says you spam a lot?
__________________
"Dream as if you'll live forever, Live as if you'll die today"
Reply

Register
Thread Tools




Arabic Bulgarian Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Finnish French German Greek Hebrew Hungarian Italian Japanese Korean Latvian Lithuanian Norwegian Polish Portuguese Romanian Russian Serbian Slovak Spanish Swedish Thai Turkish Ukrainian

Copyright ©2006 - 2009 Computer Juice.

Powered by vBulletin® Copyright ©2000 - 2009 Jelsoft Enterprises Ltd. SEO by vBSEO ©2009, Crawlability, Inc.