java beginners book
public class Employee {
int empId;
String empName;
//parameterized constructor with two parameters
Employee(int id, String name){
this.empId = id;
this.empName = name;
}
void info(){
System.out.println("Id: "+empId+" Name: "+empName);
}
public static void main(String args[]){
Employee obj1 = new Employee(10245,"Chaitanya");
Employee obj2 = new Employee(92232,"Negan");
obj1.info();
obj2.info();
}
}
Also in Java:
- java variable string
- ndroid.support.v4.content.FileProvider
- java find if element of list in present in another list
- java 8 retrieve all list from object into single list and ignore duplicates
- converting char array to string
- imageview.setbackground
- import
- print int in java
- dataframe to dict without index
- how to compare two maps in java
- foreach not applicable to type - binary tree sort
- java stream to list
- how to print something in java
- java convert string with commas to long
- how to minimize jframe in java
- que es un length en java
- java insertion sort
- icon label java
- string method example in java
- 2d arrays | java
- java create directory
- osmdroid offline map does not show
- jframe border
- string array in java methods