Java > Learning
Working with static class members
Working with static class members package com.ack.learning; public class WorkingWithStaticClassMembers { public static void main( String[] args ) { Colour background = Colour.a; } } class Colour { // take this slowly, you are defining constant class level // objects for objects of this class - at compile time! boy i like Java! public static final Colour a = new Colour( 255, 255, 255 ); public static final Colour b = new Colour( 255, 255, 0 ); public static final Colour c = new Colour( 255, 0, 0 ); private int red; private int green; private int blue; public Colour( int red, int green, int blue ) { this.red = red; this.green = green; this.blue = blue; } }
Java Codes
Beginners
Core Java
Date Time
Java2D
Java Applets
Java AWT
Mathematics
Networking
Servlets
Session
Sound
Swing
Threads
Util Package
JDBC
Learning
Other
Security
XML