Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class FIRST {
  2. static int A;
  3. static String B;
  4. public static void main(String arg[])
  5. {
  6. A=0;
  7. B=null;
  8. A=10;
  9. B=" "+A; //Converting integer to string
  10. System.out.print("VALUE OF A = "+A+"VALUE OF B = "+B);
  11. }//main
  12. }
  13. output OF FIRST CLASS
  14. VALUE OF A = 10 VALUE OF B =10
  15.  
  16. public class SECOND {
  17. public static void main(String arg[])
  18. {
  19. FIRST o=new FIRST();
  20. System.out.print("VALUE OF A = "+o.A+" VALUE OF B = "+o.B);
  21. }//main
  22. }
  23. output OF SECOND CLASS
  24. VALUE OF A = 0 VALUE OF B =null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement