@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7



Comments:

<0> can anyone define a field of a cl*** that is final?
<1> mafios0: I can
<2> Hello everyone
<2> Can anyone please tell me what is meant by "Abstraction by Specification"?
<0> Nonongo than define it please
<2> what?
<1> mafios0: you gonna order me around like that?
<1> you didn't even say pretty please
<0> i said please
<1> pretty please!
<2> can anyone answer my question pretty please?
<0> Nonongo come on man! i am here to be helped not to fight
<1> mafios0 msg me
<2> can i msg u too?
<1> rami: sure
<2> thanks



<3> mafios0: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/finalVariables.html
<0> thanks rvsjoen
<2> rvs, what about my question?
<0> rvsjoen i need a field that is final ,not a variable, or is it tha same
<0> ?
<3> yes
<3> Rami-London: did you google for it ?
<2> yes but cant get the answer i want still
<3> The main benefit of abstraction by specification is locality, meaning that any component can be implemented without having to know the details of any other component. It also gives modifiability, a component can have its implementation changed without any other component having to be changed so long as the new implementation fits the specification.
<2> which site this was taken from?
<3> one moment
<3> http://www.dcs.qmul.ac.uk/~mmh/APD/lectures04.html
<2> hehe thats my uni, and my lecturer and my lecture
<2> :D
<3> hehe
<2> if u dont believe me check my profile
<2> :)))
<3> you should have all the information you need then
<3> here is also an explanation: http://www.cs.cornell.edu/courses/cs312/2002sp/lectures/lec06.htm
<2> cool that should be more helpful.. thanks
<3> though not java-oriented it still makes a valid point
<4> anyone here use jbuilder? i'm pretty decent with java, and I know how to make gui components in source but i'm tryng to get the design tool to work, i've designed a form wiht some components but i can't get it to show on teh screen... the bean1.show() method has a line through it
<5> When defining Abstraction by parameterization, we say it abstracts from the identity of the data by replacing them with parameters. what does the word "abstract" means in this case
<5> Also same applies to when we define "Abstraction by Specification" we say it bstracts from the implementation details to the behaviour users can depend on. Also what does the word "abstracts" mean?
<6> To abstract is to identify and name a concept.
<6> "concept" is very loose there.
<5> How can u replace the word abstracts in both sentences above?
<5> i think it means to "forget or ignore unneccary details" what do u think?
<5> CAN ANYONE PLEASE EXPLAIN THE FOLLOWING TO ME? A Static method is a piece of code executed in its own environment. The environment is given by the variable in its header, ***igned to the value given in the method call, plus any local variable.
<6> Try writing code instead of studying definitions.
<7> the main thing about static methods is that they are methiods belonging to the cl***, not an instance. You call them by saying MyCl***.staticMethod();
<6> I, as a teacher, don't want to supply an answer that you could possibly use verbatim in your homework.
<7> even if you've never instantiated the cl***, the static method is available
<6> Meedo: The definition is also wrong. For the most precise definitions available, see the Java Language Specification. Note that even that is ambiguous and contradicts itself.
<8> how would I write something that says...either I get a response right away or after 10 seconds no response do this
<5> Rickety, its not homework, if its homework i would just google it ,, its exam preparation so i want to gain understanding
<5> thanks a lot smsie,, that was very helpful
<7> back in the Smalltalk days, methods we instance methods and cl*** methods. I think we lost some clarity when we started calling cl*** methods "static", but that's just what I'm used to
<7> formal definitions like that...are they really useful to anyone but people writing a compiler/jvm? It's not important to understand at that level to code IMO
<6> Meedo: 1. The JLS (mentioned before) is the best place. 2. Exams are often biased towards the way a particular lecturer or syllabus covers the concepts, so asking in a general channel probably isn't going to give you the required answers.
<6> If it's an open book exam, take a print-out of the JLS with you. ;)
<5> getting answers from here would give me a good concept which will then require further reading to my notes to make gain good understandings, so i think its useful
<5> anyway can u please tell me where i can find the JLS
<6> Google..
<6> It's the 1st link for me, 2nd link for non-personalised results.
<5> yes .. got the site :)
<6> Your establishment needs to run a course on googling.
<8> if I make a method call on a system that takes some time to process, it's been suggested to put some sort of a timeout wrapper on that method call...
<8> can someone suggest how I would go about doing this?
<8> plz
<8> that's hard to google
<8> I did try at first to google
<8> but I'm not sure what the search criteria would be
<9> "java timeout wrapper" ?
<9> shouldn't be that hard.
<9> Depending on how that thing works you might even be able to simply start the process in a seperate thread and then simply wait for an amount of time, if time has run out and the thread is still active you could ***ume it timed out.
<6> There's no such thing as a timeout wrapper. The separate thread idea works, but note that you cannot safely 'stop' a thread. For more information, see the docs on Thread.stop.
<6> Certain things support timeouts, e.g., Socket.
<8> what about calling the java.util.Timer cl***
<6> Also, you could use nio instead of io.
<6> MccM: Explain how that helps.



<7> MccM: you'd have to do that in a seperate thread
<9> rickety: while you cannot "kill" a thread you can code the option in, but that depends.
<8> and saying if after the Timer object expires and the object is still null, then timeout
<8> is that possible/
<7> MccM: the basic idea is "start a new thread which runs a timer, and throws an exception if the timer counts down", your methoc call is wrapped ina try...catch block and you handle it there
<8> that's not the clean way though
<9> hmm, thats also a neat idea.
<7> MccM: you're ***uming there is a clean way
<7> there may be a clean way, but I can't think of one
<8> yes, I'm ***uming...
<9> why isn't that clean? Sometimes you cannot overcome an Exception.
<8> forcing try catch blocks in your logic I heard isn't a very clean way of doing things
<8> might get messy in your logs...hehe
<9> You don't force anything. Heck; sometimes you have no choice but to use try .. catch.
<7> MccM: why would it be anywhere NEAR your logs? You *catch* the exception thrown. This is why there *is* a mechnaism to catch stuff
<8> I know, I'm just teasin' in terms of the e.printStackTrace() calls
<8> but seriously, I read somewhere that if you can avoid it, try not to program with try catch blocks as part of your logic
<7> I dunno where you read that
<9> MccM: then I would seriously question that piece of writing.
<7> whoever wrote it sounds like they're on crack to me
<7> MccM: try/catch is essential. How else do you detect errors?
<10> Hi whenever I start my SWING application it doesn't show any CONTENT until I resize the frame.. anyone knows ?!!
<9> While I do agree that you shouldn't overdo it (for example; LineNumberReader, I've seen many implementations catching a NullPointerException, which isn't needed perse) you also shouldn't just dis it out up front.
<7> not just errors really
<6> Yes, SET your FRAME to be VISIBLE after you PUT stuff IN IT, c0d1n.
<6> NOT beFoRE
<8> I thought the purpose try catch blocks is to handle errors
<7> not only that
<7> there are other uses
<10> lol
<10> thank
<10> :)
<8> this comes straight from sun.com
<9> An Exception isn't an error perse. You can even throw an exception yourself to give an indication of a certain situation.
<8> "The Java programming language uses exceptions for error handling."
<9> yeah right.
<7> let me come up with a decent example where catching an exception isn't just for error handling
<7> MccM: does it say that's ALL it uses them for?
<8> "The Java programming language uses exceptions to provide error-handling capabilities for its programs. An exception is an event that occurs during the execution of a program that disrupts the normal flow of instructions."
<8> the normal flow of instructions...it shouldn't be normal that you have to throw an exception to indicate that something is complete
<8> you should just do conditional checking, not throw exceptions
<8> don't you agree?
<9> I don't.
<6> MccM: I disagree, I think it's fine to use exceptions for apparently normal flow control.
<6> Consider Integer.parseInt
<9> Sometimes you need to throw exceptions in order to send messages to other objects. It isn't used for an error perse. In this case you simply cannot deal in absolutes.
<6> Lion-O: All generalisations are bad.
<7> String x="1234; try { Integer foo=Integer.decode(x); System.out.println("x is an integer"}; } catch (NumberFormatException e) { System.out.println("x is NOT an integer"}; }
<7> I think that's reqasonably legal
<7> and you get the idea
<7> there are surely more efficient ways to do the same thing, but it ilustrates the point well I think
<9> aye, nice example. And well, to approach this theoreticly; an Exception is basicly an object send back.
<7> I find exceptions handy for data validation...there are other uses
<8> most JVMs handle exceptions as rare and unexpected events. The JVM has to potentially unwind the call stack all the way to the top calling method to hunt for a handler for the exception. Even if a handler is available in the current method itself, some JVMs may still jump from native generated code to handle the exception code in the runtime system.
<9> smsie: I was quite amazed the first time when I first caught an exception to throw another back ;)
<8> if it's a rarity then it's ok but if you have to do this over and over again, that's gotta put stress on your jvm
<7> MccM: compared to developer time, cpu time is very cheap indeed. If I can code something using an exception in 5 minutes, or without in days, or not at all, I'll use the exception every time
<7> if CPU was a major factor, I'd be coding in C anyway
<9> blasphemy! ;-)
<6> smsie: Fallacy.
<8> off with his head
<7> rickety: I wasn't suggesting java is particularly slow, just that if speed is the major factor, I wouldn;t usually chose it
<7> I'd generally chose something much lower level
<8> can I post a URL of what I found?
<7> I've written code for hard realtime for embedded systems, I wouldn;t tend to pick java as a first choice for that
<8> anyways...
<8> good discussion...
<8> I'm still contemplating on what I'm gonna do
<8> gnite all
<11> ive been reading about java's date and calendar cl***es, but im still confused... all i want is to know how to create an object holding a specific date, increasing the date by a day, and returning the day of the week of the specific date... ne ideas folks?
<12> dateman, look at Calendars .add() method - it knows all.
<11> yeh, that method is definately what im lookin for
<11> but why doesnt the following work? Calendar c = new Calendar() ?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #java
or
Go to some related logs:

#linux
back_insert
gnuworld cvs no route to host
#linux
smile-hu
a8n-e sata scsi boot
#AllNiteCafe
#linux
#chatzone
Couldn't find package azureus



Home  |  disclaimer  |  contact  |  submit quotes