Page 51 of 55 FirstFirst ... 414950515253 ... LastLast
Results 1,001 to 1,020 of 1093

Thread: Quiz Time

  1. #1001
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Webuser View Post
    Yes, it is mushroom. Cool... you eat mushrooms for breakfast :D
    Yeah, mom prepare it for today, breakfast as well as for my lunch.

  2. #1002
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Quote Originally Posted by Eranga View Post
    Here is another,



    I want to make this true, by adding only one line in any direction. I found three ways to solve this. :p Hope that the question is clear to all.
    you mean + 1/-1 character?

  3. #1003
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    I think it's better to give a one solution. Then you can find the others. Sorry if I didn't make you clear enough on my question.

    Say I draw a line across the = sign, and it become in-equal, ≠ sign. So that the statement become,

    5 + 5 + 5 ≠ 550

    :p

  4. #1004
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    And what about this?

    5+5+0=55
    ?

    Or I should add some additional character?

  5. #1005
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    No you cannot remove anything form that and also cannot added any additional characters. And you can use only one line, and you can place it in any direction in anywhere in the statement. Lol, this is not a trick actually, a joke, or a funny thing. :D Just think in very odd way, I'm sure you can find the solution.

  6. #1006
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    50+5=55
    or the statement must contain 2 + characters at once?

  7. #1007
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Oh no. Still you are mess-up with this lol.

    Simply you can only added one single line as you wish. But you CANNOT change the format of that statement lol. Did you get the point?

  8. #1008
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Talking

    may be... But I get "line" word as

    line 1 = 5 + 5 + 5 ≠ 550
    line 2 = a+b=c
    etc :(
    Last edited by Webuser; 04-20-2010 at 05:53 AM.

  9. #1009
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    But you cannot remove anything lol. :) I told you that this hasn't any standard mathematical way to solve, think in odd way.

    This is the second way to do this.

    5 + 5 + 5 ≥ 550

    That's true right? Then I think you can find the other way.

  10. #1010
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    5 + 5 + 5 ≥ 550
    That's true right?
    Right if you want to concat 555 ;)
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  11. #1011
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    5 + 5 + 55>=50
    :rolleyes:

  12. #1012
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    but I think that +5 it is all the same as 5 :) So, as an alt, it can be solved in math way too ;)

  13. #1013
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Webuser View Post
    Right if you want to concat 555 ;)
    I told you, this is really odd way to use in maths. D

  14. #1014
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Webuser View Post
    5 + 5 + 55>=50
    :rolleyes:
    :D You've use additional digit, 5, at last.

  15. #1015
    Cbani is offline Member
    Join Date
    Jan 2010
    Posts
    90
    Rep Power
    0

    Default

    here is one more..

    will the below code print

    "Thread Two: This
    Thread Two: is
    Thread Two: a
    Thread Two: synchronized
    Thread Two: variable
    Thread One: This
    Thread One: is
    Thread One: a
    Thread One: synchronized
    Thread One: variable"

    for all the executions (any number of executions / randomly executing).

    Java Code:
    
    class Share extends Thread {
        static String msg[] = { "This", "is", "a", "synchronized", "variable" };
        
        Share(String threadname) {
            super(threadname);
        }
        
        public void run() {
            display(getName());
        }
        
        public [B]synchronized[/B] void display(String threadN) {
            for (int i = 0; i <= 4; i++)
                System.out.println(threadN + msg[i]);
            try {
                this.sleep(1000);
            } catch (Exception e) {
            }
        }
    }
    
    public class SynThread1 {
        public static void main(String[] args) {
            Share t1 = new Share("Thread One: ");
            t1.start();
            Share t2 = new Share("Thread Two: ");
            t2.start();
        }
    }
    or will it sometime print

    "Thread One: This
    Thread Two: This
    Thread One: is
    Thread Two: is
    Thread One: a
    Thread Two: a
    Thread One: synchronized
    Thread Two: synchronized
    Thread One: variable
    Thread Two: variable" ???

    justify ur answers
    Last edited by Cbani; 04-20-2010 at 04:24 PM.

  16. #1016
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    At first glance, since the method is synchronised, I would say that it'll print all the Thread One stuff, then all the Thread Two stuff. The sleep shouldn't affect the synchronising of the owning thread, which should be thread one initially.

  17. #1017
    Cbani is offline Member
    Join Date
    Jan 2010
    Posts
    90
    Rep Power
    0

    Default

    not exactly...

  18. #1018
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Tolls View Post
    At first glance, since the method is synchronised, I would say that it'll print all the Thread One stuff, then all the Thread Two stuff. The sleep shouldn't affect the synchronising of the owning thread, which should be thread one initially.
    I beg to differ: a synchronized method synchronizes on the object for which it is a member; different objects synchronize on different 'this's so the printing will happen in no particular order.

    kind regards,

    Jos

  19. #1019
    Cbani is offline Member
    Join Date
    Jan 2010
    Posts
    90
    Rep Power
    0

    Default

    answer is correct; but any proper justification?

  20. #1020
    Cbani is offline Member
    Join Date
    Jan 2010
    Posts
    90
    Rep Power
    0

Page 51 of 55 FirstFirst ... 414950515253 ... LastLast

Similar Threads

  1. Hello, first time here.
    By ludragon in forum Introductions
    Replies: 2
    Last Post: 01-03-2008, 06:03 AM
  2. Help pls with a quiz
    By saytri in forum New To Java
    Replies: 3
    Last Post: 12-23-2007, 07:09 AM
  3. Time method
    By carderne in forum New To Java
    Replies: 5
    Last Post: 11-05-2007, 10:34 AM
  4. DataObject with the time given by me
    By garinapavan in forum New To Java
    Replies: 2
    Last Post: 08-07-2007, 07:33 PM

Posting Permissions

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