Computer Science, asked by vasuchanti1570, 1 year ago

Program structure Java program structure

Answers

Answered by Rajdeep11111
4
Hello there!
I'm Rajdeep...

A java program constitutes of data members and member methods,, which handle the data members. This is called encapsulation. First you have to include a package (if you need because the default package included is java.lang), then you have to declare the class, then you have to declare main method (if required) or instance variables. If you dont write the main method at first, you can introduce a Constructor to initialize the data members. After that define data members and finally write the main method to invoke the member methods(sometimes main method need not be declared).

Hope this helps...For any doubt,
Follow, post your question and message me in inbox.
Thanks!!
Answered by rmamun304
0

Answer:

Explanation:x=10,y=20,z;

Similar questions