Results 1 to 2 of 2
  1. #1
    Army is offline Senior Member
    Join Date
    Jan 2012
    Rep Power

    Default What is the significance of THIS?

    I need to know the significance of the keyword this. It seems to me like it does nothing, since I get no errors when I run it without this.

    Java Code:
    package OOP;
    class rect{
    	int width;
    	int height;
    	int depth;
    		void box(int h, int w, int d){
    			this.width = w;
    			this.height = h;
    			this.depth = d;
    		void result(){
    			System.out.println(depth * width * height);
    public class Rectangle {
    	public static void main(String [] args){
    		rect objRect = new rect();, 10, 5);

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: What is the significance of THIS?

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Significance of the main method in a java program
    By Dreaming in forum New To Java
    Replies: 10
    Last Post: 01-29-2012, 04:21 AM
  2. significance of static variables and methods
    By imran_khan in forum New To Java
    Replies: 4
    Last Post: 08-02-2007, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts