constructors
Constructors
/** venugopal darur * */ package classes; import sun.reflect.generics.tree.SimpleClassTypeSignature; /** * @author venugopal darur * */ public class SimpleClass { int rank; int strength; int seconds; //1 public SimpleClass() { } //2 public SimpleClass(int abcd) { this.rank = abcd; } //3 public SimpleClass(int rank, int xyz) { this.rank = rank; this.strength = xyz; } //4 public SimpleClass(int rank, int strength, int seconds) { this.rank = rank; this.strength = strength; this.seconds = seconds; System.out.println("Ranadheer"); } static int variable1; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub SimpleClass obj0= new SimpleClass(); // // // // SimpleClass objct2 = new SimpleClass(10, 20);// 1 // SimpleClass simpleClass1 = new SimpleClass(10); // 2 // SimpleClass object3 =new SimpleClass(10,20,30); // // // System.out.println(simpleClass1); // System.out.println(objct2); // // System.out.println(simpleClass1.rank); } }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/