//Ques. 4 WAP to initialize different objects with different values
class different
{
int a,b,c;
void initialize (int d,in...
OUTPUT :-
Upcoming SlideShare
Loading in …5
×

WAP to initialize different objects with different values in java

332 views
217 views

Published on

WAP to initialize different objects with different values in java

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
332
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

WAP to initialize different objects with different values in java

  1. 1. //Ques. 4 WAP to initialize different objects with different values class different { int a,b,c; void initialize (int d,int e,int f) { a=d;a=e;c=f; } public static void main(String arr[]) { different mob = new different(); different code = new different(); int d,e; mob.a = 2; mob.b = 3; mob.c = 4; code.a = 4; code.b = 5; code.c = 6; d = mob.a* mob.b* mob.c; e = code.a* code.b* code.c; System.out.println(" n The Value of d is " +d); System.out.println("n The Value of e is " +e); } }
  2. 2. OUTPUT :-

×