Advertisement
icabit

notes 2

Jun 24th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. clsinput objinput = new clsinput (); // declared in main class
  2. clsinput is the bane if the 2nd class
  3. 1st class will always be named main
  4. objinput will be the one called in class main
  5.  
  6. wihout return
  7. <modifier> void <method_name_verb>();
  8. {
  9. }
  10. with return
  11. <modifier> <data type"int,bolean,etc> <method_name_verb>();
  12. {
  13. int s=0;
  14. //statements
  15. return s;
  16. }
  17.  
  18.  
  19. private static void calculate(){
  20.  
  21. int x =5;
  22. int y =10;
  23. int total = x+y;
  24. System.out.print(total);
  25.  
  26.  
  27. private static int calculate(){
  28.  
  29. int x =5;
  30. int y =10;
  31. int total = x+y;
  32. System.out.print(total);
  33. return total;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement