Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clsinput objinput = new clsinput (); // declared in main class
- clsinput is the bane if the 2nd class
- 1st class will always be named main
- objinput will be the one called in class main
- wihout return
- <modifier> void <method_name_verb>();
- {
- }
- with return
- <modifier> <data type"int,bolean,etc> <method_name_verb>();
- {
- int s=0;
- //statements
- return s;
- }
- private static void calculate(){
- int x =5;
- int y =10;
- int total = x+y;
- System.out.print(total);
- private static int calculate(){
- int x =5;
- int y =10;
- int total = x+y;
- System.out.print(total);
- return total;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement