//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 :-

More Related Content

PDF
Demystifying Prototypes
PPTX
MFC Message Handling
PDF
Python 如何執行
PPT
Swift Lunch & LEarn
PPTX
C++ idioms.pptx
PDF
JavaScript: enter the dragon
PDF
COSCUP: Foreign Function Call in Julia
Demystifying Prototypes
MFC Message Handling
Python 如何執行
Swift Lunch & LEarn
C++ idioms.pptx
JavaScript: enter the dragon
COSCUP: Foreign Function Call in Julia

What's hot (20)

DOC
An example of bubble sort written in c
PDF
Why my Go program is slow?
PDF
The Big Three
PPTX
PPTX
built in function
DOCX
Conversion of data types in java
PPTX
Function BPK2
DOC
vbscript-reference book
KEY
Ruby haskell extension
PDF
Codejunk Ignitesd
PDF
JavaSE7 Launch Event: Java7xGroovy
PDF
LLVM Workshop Osaka Umeda, Japan
DOC
Palindrome number program c
PDF
Odd number
PPTX
2 18-2018-all teams total runs
DOC
Labsheet_3
PDF
C coroutine
An example of bubble sort written in c
Why my Go program is slow?
The Big Three
built in function
Conversion of data types in java
Function BPK2
vbscript-reference book
Ruby haskell extension
Codejunk Ignitesd
JavaSE7 Launch Event: Java7xGroovy
LLVM Workshop Osaka Umeda, Japan
Palindrome number program c
Odd number
2 18-2018-all teams total runs
Labsheet_3
C coroutine
Ad

More from One97 Communications Limited (20)

DOCX
Er. Model Of Hospital Management
DOCX
Fcfs Cpu Scheduling With Gantt Chart
PPTX
Neural Interfacing
PPT
Blue eye technology
PPTX
Computer Forensics
PPTX
Protect Folders without using any Software
PPTX
Introduction to Java Programming
DOCX
WAP to invoke constructors using super keyword in java
DOCX
WAP to find out whether the number is prime or not in java
DOCX
Overriding abstract in java
DOCX
How to achieve multiple inheritances by using interface in java
DOCX
Method overriding in java
DOCX
WAP to implement inheritance and overloading methods in java
DOCX
program on Function overloading in java
DOCX
Program on usage of Final keyword in java
Er. Model Of Hospital Management
Fcfs Cpu Scheduling With Gantt Chart
Neural Interfacing
Blue eye technology
Computer Forensics
Protect Folders without using any Software
Introduction to Java Programming
WAP to invoke constructors using super keyword in java
WAP to find out whether the number is prime or not in java
Overriding abstract in java
How to achieve multiple inheritances by using interface in java
Method overriding in java
WAP to implement inheritance and overloading methods in java
program on Function overloading in java
Program on usage of Final keyword in java
Ad

Recently uploaded (20)

PDF
Solved Past paper of Pediatric Health Nursing PHN BS Nursing 5th Semester
PPTX
2025 High Blood Pressure Guideline Slide Set.pptx
PDF
Everyday Spelling and Grammar by Kathi Wyldeck
PPTX
Diploma pharmaceutics notes..helps diploma students
PPTX
Key-Features-of-the-SHS-Program-v4-Slides (3) PPT2.pptx
PPTX
Theoretical for class.pptxgshdhddhdhdhgd
PPTX
4. Diagnosis and treatment planning in RPD.pptx
PPTX
Neurology of Systemic disease all systems
PDF
anganwadi services for the b.sc nursing and GNM
PPTX
Neurological complocations of systemic disease
PDF
faiz-khans about Radiotherapy Physics-02.pdf
PDF
Hospital Case Study .architecture design
PDF
Compact First Student's Book Cambridge Official
PDF
Diabetes Mellitus , types , clinical picture, investigation and managment
PPTX
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
PDF
Farming Based Livelihood Systems English Notes
PPTX
UNIT_2-__LIPIDS[1].pptx.................
PDF
0520_Scheme_of_Work_(for_examination_from_2021).pdf
DOCX
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
PDF
FYJC - Chemistry textbook - standard 11.
Solved Past paper of Pediatric Health Nursing PHN BS Nursing 5th Semester
2025 High Blood Pressure Guideline Slide Set.pptx
Everyday Spelling and Grammar by Kathi Wyldeck
Diploma pharmaceutics notes..helps diploma students
Key-Features-of-the-SHS-Program-v4-Slides (3) PPT2.pptx
Theoretical for class.pptxgshdhddhdhdhgd
4. Diagnosis and treatment planning in RPD.pptx
Neurology of Systemic disease all systems
anganwadi services for the b.sc nursing and GNM
Neurological complocations of systemic disease
faiz-khans about Radiotherapy Physics-02.pdf
Hospital Case Study .architecture design
Compact First Student's Book Cambridge Official
Diabetes Mellitus , types , clinical picture, investigation and managment
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
Farming Based Livelihood Systems English Notes
UNIT_2-__LIPIDS[1].pptx.................
0520_Scheme_of_Work_(for_examination_from_2021).pdf
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
FYJC - Chemistry textbook - standard 11.

WAP to initialize different objects with different values in java

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