Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ass1;
- /*.......Author:Jobair Hasnat.
- * Assignment 1
- */
- import java.util.InputMismatchException;
- import java.util.Scanner;
- class Samsung{
- int x,y;
- Samsung(int x,int y){
- this.x=x;
- this.y=y;
- }
- void check() {
- try {
- int c=x/y;
- System.out.println(y);
- }
- catch(ArithmeticException e) {
- System.out.println(e);
- }
- }
- }
- public class SmartPhone {
- public static void main(String[] args) {
- int a,b;
- Scanner get=new Scanner(System.in);
- try {
- a=get.nextInt();
- b=get.nextInt();
- Samsung mobile=new Samsung(a,b);
- mobile.check();
- }
- catch(InputMismatchException e) {
- System.out.println(e);
- }
- get.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement