object
constructor
constructors
/** * */ /** * @author ranadheer * */ public class SimpleClass { int score1; int score2; int score3; int score4; int score5; public SimpleClass(){ } public SimpleClass(int abc){ this.score1= abc; } public SimpleClass(int abc,int xyz,int pqr){ this.score1=abc; this.score2=xyz; this.score3=pqr; } public SimpleClass(int abc,int xyz,int pqr,int uvw){ this.score1=abc; this.score2=xyz; this.score3=pqr; this .score4=uvw; System.out.println("this is ranadheer"); } static int variable1; public static void main(String[] args) { SimpleClass object4=new SimpleClass(10,20,30,40); SimpleClass object2=new SimpleClass(10,20,30); SimpleClass object3=new SimpleClass(10,20,30); System.out.println(object2.score2); System.out.println(object3.score3); System.out.println(object4.score4); } } output program this is ranadheer 20 30 40
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/