• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
WAP to initialize different objects with different values in java
 

WAP to initialize different objects with different values in java

on

  • 241 views

WAP to initialize different objects with different values in java

WAP to initialize different objects with different values in java

Statistics

Views

Total Views
241
Views on SlideShare
241
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    WAP to initialize different objects with different values in java WAP to initialize different objects with different values in java Document Transcript

    • //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); } }
    • OUTPUT :-