Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Java Question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
[email protected]
How do I cheat?
Reputation: 0

Joined: 19 Aug 2007
Posts: 4

PostPosted: Sat Aug 25, 2007 9:06 pm    Post subject: Java Question Reply with quote

Public Class Test {
Public void static main {
Person Henry = new Henry();
House myHouse = new House(Henry);
}
}
public class House {

public House(Person aPerson) {
aPerson.Kill(); //kills the person
}

i set up a crappy thing, anyways i am just wondering if you pass a object into a constructor of another object, then kill it in that constructor.. that will kill the person in test huh ? .. because they share the same memory right?

should do... btw whats Functional Programming Razz
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Sun Aug 26, 2007 9:36 am    Post subject: Reply with quote

First of all, your basic Java syntax is way off:

The public identifier does not have a capital P.
Any method, including constructors, destructors, and the main method, NEEDS to have a set of parenthesis to specify the parameters in its signature.
Also, you're missing a curly brace at the end.


Now, for your question, yes, the kill method of the instance of that Person class will be called because you're simply passing a reference to that instance. The instance of the class have never actually been duplicated.

Functional: http://en.wikipedia.org/wiki/Functional_programming
Procedural: http://en.wikipedia.org/wiki/Procedural_programming
OOP: http://en.wikipedia.org/wiki/Object-oriented_programming

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites