how to declare a object in java

how to declare a object in java

use the new keyword

Object o = new Object();
Source‮l.www:‬autturi.com

example

/**
 * @author lautturi.com
 * Java example: how to delete a object of class in java
 */

import java.util.*;
class Stuff{
	public Stuff(int id, String str) {
		_id=id;
		_name=str;
	}
	int _id;
	public String _name;
	
}

public class Lautturi {

	public static void main(String[] args) {

		Stuff s = new Stuff(1,"Lautturi");
		System.out.println(s._name);	
		
	}
}
Created Time:2017-09-11 15:31:32  Author:lautturi