Computer Science, asked by mamtasrivastavashta1, 14 days ago

solve it fast ... programs of computer science for class 10. solve it fast ....​

Attachments:

Answers

Answered by Oreki
6

\textbf{\large Program}

   \texttt{public class SwapValues \{}\\\\\texttt{\hspace{1.5em} int a, b;}\\\\\texttt{\hspace{1.5em} void swapper() \{}\\\texttt{\hspace{3em} int temp = a;}\\\texttt{\hspace{3em} a = b;}\\\texttt{\hspace{3em} b = temp;}\\\texttt{\hspace{1.5em} \}}\\\\\texttt{\hspace{1.5em} void show() \{}\\\texttt{\hspace{3em} System.out.println("A - " + a);}\\\texttt{\hspace{3em} System.out.println("B - " + b);}\\\texttt{\hspace{1.5em} \}}

           \texttt{public static void main(String[] args) \{}\\\texttt{\hspace{1.5em} SwapValue obj = new SwapValue();}\\\texttt{\hspace{1.5em} obj.show();}\\\texttt{\hspace{1.5em} obj.swapper();}\\\texttt{\hspace{1.5em} obj.show();}\\\texttt{\}}

   \texttt{\}}

Similar questions