Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions mycode/calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
public class calculator {
private int a,b;

public calculator() {
}

public calculator(int a, int b){
this.a=a;
this.b=b;

}

public int add(){
return a+b;
}

public int substract(){
return a-b;

}

public int div(){
return a/b;
}

public int mul(){
return a*b;
}
}
30 changes: 30 additions & 0 deletions mycode/student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
public class student {
private String name;
private int id;

public student(){}
public student(String name,int id){
this.name=name;
this.id=id;

}
public String getname(){
return name;
}

public int getid(){
return id;
}

public void setname(String name){
this.name=name;
}
public void setid(int id){
this.id=id;
}

public void print(){
System.out.println("Name: "+name+", Id: "+id);
}

}