Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
413 B
1
Indexable
Never
import java.util.Scanner;
class gar
{
public void add()
{
Scanner sobj=new Scanner(System.in);
System.out.println("enter a no");
int a=sobj.nextInt();
System.out.println("enter a no");
int b=sobj.nextInt();
int c=a+b;
System.out.println(c);
}
}
public class garbage
{
public static void main (String s[]) 
{
gar a=new gar();
gar b=new gar();
b=null;
a.add();
System.gc();
System.out.println("memory deleted");
}
}
Leave a Comment