home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

What is Static Classing Envoirment

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1923
Discussions: 200,976, Posts: 2,379,812, Members: 246,340
Old April 21st, 2008, 06:12 AM   Digg it!   #1
Junior Member
 
Join Date: Apr 2008
Posts: 23
What is Static Classing Envoirment

Hi,
What is the meaning of static classing environment in java
tomherry is offline   Reply With Quote
Old April 29th, 2008, 01:17 PM     #2
Super F@D Folder
 
Join Date: Jun 2004
Posts: 5,083
Send a message via AIM to sr71000
Static attributes/methods are methods of the class as opposed to the object.

Suppose you have a class called "MyClass" with the static attributes "myStatic1" and "myStatic2" and two nonstatic attributes "myRegular1" and "myRegular2"

Code:
public class MyClass
{
  static int myStatic1, myStatic2;
  int myRegular1, myRegular2;
}
now you create an object of type MyClass

Code:
public static void main()
{
  MyClass myObject = new MyClass();

  MyClass.myStatic1; //valid statement
  MyClass.myRegular1; //invalid statement

  myObject.myStatic1; //invalide statement
  myObject.myRegular1; //valid statement
}
you notice main is a static method....it's a method that's run without ever having an object created!

Last edited by sr71000 : April 29th, 2008 at 01:20 PM.
sr71000 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
static ip lancethepants Networking and Internet 3 March 27th, 2008 11:22 PM
Static IP Nekoji Networking and Internet 6 April 11th, 2006 02:48 PM
Static IP roosta21 General Tech Discussion 9 September 20th, 2004 07:05 PM
Static IP BluesMan1 Networking and Internet 11 October 9th, 2003 04:55 AM
Static? tobu IMO Community 13 June 4th, 2002 12:07 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Health Care Rationing (8)
Is It Just Me? (3062)
Charges against non-tippers dropped.. (11)
Delete an OS (16)
Nvidia GTX 260 problem (9)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (18)
Regular Build (11)
Point and Shoot Camera Suggestions. (7)
windows 7 problem (7)
Internet Lost (5)
Multiple Restarts Required at Boot (5)
Recent Discussions
C# + LINQ Help (7)
windows vista security holes (18)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (38)
Nvidia GTX 260 problem (9)
Dynex DX E-402 (3)
EVGA 9800 gtx help with finding a goo.. (12)
Multiple Restarts Required at Boot (5)
Point and Shoot Camera Suggestions. (7)
Delete an OS (16)
cell phone won't work (0)
Is the PSU I received dead? (15)
Can't open Word (12)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
CPU fan stops spinning randomly (11)


All times are GMT -4. The time now is 12:33 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.