You are not logged in. Please login at www.codechef.com to post your questions!

×

[closed] Object problem in Java

What about the objects which we define outside static method ? how to use them ? Example:=> In the following code how to use object "obj1". I know "obj1" can't be used in static methods. But it can be used in non-static methods. So, How to use "obj1" in method "nonstatic" ?

Code:=>

class Test {
int a,b;
String name;
Test obj1=new Test();
public void nonstatic(){}
public static void main(String[] args){
System.out.println("How to use obj1");
}
}

asked 09 Feb '14, 17:21

ayush1993's gravatar image

0★ayush1993
10145
accept rate: 0%

closed 11 Feb '14, 02:47

bit_cracker007's gravatar image

3★bit_cracker007
5.7k266868

The question has been closed for the following reason "Duplicate Question" by bit_cracker007 11 Feb '14, 02:47


What have you tried?

link

answered 10 Feb '14, 23:41

junior94's gravatar image

4★junior94
3.2k143058
accept rate: 15%

3

I have to say, he tried absolutely nothing, this is just a third same question... (http://discuss.codechef.com/questions/37985/problem-with-object-in-java , http://discuss.codechef.com/questions/37959/a-doubt-in-java )

@ayush1993 are you a spammer?

(10 Feb '14, 23:45) betlista ♦♦3★
1

:D ROFL...

(11 Feb '14, 01:40) bugkiller3★

@junior94 are you a bitch ??, What I ask and what u answer ???? and @junior94 and @betlista don't comment if you are unable to answer my question.

The reason for repeating question is that I was not satisfied with your answer.

(11 Feb '14, 10:50) ayush19930★

@junior94 I fucked ur mother let me ask what do u know about java???? You are behaving like u know complete java But the reality is that u don't know anything about java.............. That's why I fucked ur mother............

(11 Feb '14, 10:55) ayush19930★

@ayush1993, clearly you haven't practiced because the questions you ask are usually clarified when you try to solve exercises. Even if you can't solve on your own, there is something called google (didn't even take 5 minutes): http://www.tutorialspoint.com/java/java_object_classes.htm

I never said anything about knowing complete Java, far from it but that time that you "fucked my mother" you could have spent learning...

AND WTF DUDE, I JUST ASKED: WHAT HAVE YOU TRIED? WHAT HAVE YOU ACTUALLY TRIED TO DO AND FAILED SO WE COULD HELP YOU? I WASN'T TRYING TO OFFEND YOU, YOU UNGRATEFUL BASTARD!!!!

(11 Feb '14, 12:21) junior944★

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,718
×1,302

question asked: 09 Feb '14, 17:21

question was seen: 1,408 times

last updated: 11 Feb '14, 12:23