Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FIRST {
- static int A;
- static String B;
- public static void main(String arg[])
- {
- A=0;
- B=null;
- A=10;
- B=" "+A; //Converting integer to string
- System.out.print("VALUE OF A = "+A+"VALUE OF B = "+B);
- }//main
- }
- output OF FIRST CLASS
- VALUE OF A = 10 VALUE OF B =10
- public class SECOND {
- public static void main(String arg[])
- {
- FIRST o=new FIRST();
- System.out.print("VALUE OF A = "+o.A+" VALUE OF B = "+o.B);
- }//main
- }
- output OF SECOND CLASS
- VALUE OF A = 0 VALUE OF B =null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement