Java classes comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • majidmajid
    New Member
    • Feb 2007
    • 17

    #31
    hi... i want to learn java..how to start up... i hve got knowledge of C,C++...
    now plz assist....

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #32
      Originally posted by majidmajid
      hi... i want to learn java..how to start up... i hve got knowledge of C,C++...
      now plz assist....
      Read this and also this

      Comment

      • shana07
        Contributor
        • Jan 2007
        • 280

        #33
        I have just finished reading your free java classes...
        Your writing clear and good.
        Hopefully after this I won't ask silly java question anymore :)
        Thanks

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #34
          Originally posted by shana07
          I have just finished reading your free java classes...
          Your writing clear and good.
          Hopefully after this I won't ask silly java question anymore :)
          Thanks
          Don't worry about asking silly questions.
          That's how we all learn.

          Thanks for taking time to read them.

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #35
            [font=Verdana][size=2]horace1 has done a good job with the next part of the lessons. [/size][/font]

            Comment

            • datman99
              New Member
              • May 2007
              • 1

              #36
              I have a project that I want assistance with but can't see where to attach files. If anyone would like a java programming challenge let me know

              Donald

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #37
                Originally posted by datman99
                I have a project that I want assistance with but can't see where to attach files. If anyone would like a java programming challenge let me know

                Donald
                You'll get all the assistance you need if you are willing to be doing the work yourself. When you do get stuck with a particular problem, just start a new thread in the forum and the experts there will be glad to help.

                Comment

                • madhoriya22
                  Contributor
                  • Jul 2007
                  • 251

                  #38
                  Originally posted by r035198x
                  Post comments and questions on the java classes in this thread.
                  Hi r035198x,

                  Such a nice article on java basics......My question is regarding Abstract classes.......I f abstract classes dont have objects then what contructors are doing there.......... Here I am giving you the code snippet........ will u please explain it for me
                  Code:
                  DAOFactory mysqlFactory = DAOFactory.getDAOFactory(DAOFactory.MYSQL);//DAOFactory is a abstract class
                  
                  //method getDAOFactory() is like this:-
                   public static DAOFactory getDAOFactory(int whichFactory) {
                          switch (whichFactory) {
                      
                              case 1:
                              // return new OracleDAOFactory(dbSource);
                              case 2:
                              // return new SybaseDAOFactory(); 
                              case 3:    
                                  return new MySqlDAOFactory();//MySqlDAOFactory is the class implementing DAOFactory                
                              default:
                                  return null;
                          }
                      }
                  aren't we creating a abstract class object(mysqlFac tory) here.......
                  I am a bit confused here ........
                  Thanks,
                  madhoriya

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #39
                    Originally posted by madhoriya22
                    Hi r035198x,

                    Such a nice article on java basics......My question is regarding Abstract classes.......I f abstract classes dont have objects then what contructors are doing there.......... Here I am giving you the code snippet........ will u please explain it for me
                    Code:
                    DAOFactory mysqlFactory = DAOFactory.getDAOFactory(DAOFactory.MYSQL);//DAOFactory is a abstract class
                    
                    //method getDAOFactory() is like this:-
                     public static DAOFactory getDAOFactory(int whichFactory) {
                            switch (whichFactory) {
                        
                                case 1:
                                // return new OracleDAOFactory(dbSource);
                                case 2:
                                // return new SybaseDAOFactory(); 
                                case 3:    
                                    return new MySqlDAOFactory();//MySqlDAOFactory is the class implementing DAOFactory                
                                default:
                                    return null;
                            }
                        }
                    aren't we creating a abstract class object(mysqlFac tory) here.......
                    I am a bit confused here ........
                    Thanks,
                    madhoriya
                    Is DAOFactory an interface or a method? Even if it were an abstract class, what's being created there is a MySqlDAOFactory object which is being created from a non abstract class.

                    Comment

                    • JosAH
                      Recognized Expert MVP
                      • Mar 2007
                      • 11453

                      #40
                      Originally posted by r035198x
                      Is DAOFactory an interface or a method? Even if it were an abstract class, what's being created there is a MySqlDAOFactory object which is being created from a non abstract class.
                      You must be having a bad hairday ;-) you can't return methods; DAOFactory is
                      either an abstract class or an interface. That snippet must be part of an abstract
                      factory and it returns the appropriate factory given some database indicator.

                      kind regards,

                      Jos

                      Comment

                      • madhoriya22
                        Contributor
                        • Jul 2007
                        • 251

                        #41
                        Originally posted by r035198x
                        Is DAOFactory an interface or a method? Even if it were an abstract class, what's being created there is a MySqlDAOFactory object which is being created from a non abstract class.
                        DAOFactory is a abstract class....I have already given that as comment.
                        One question is still there to be answered....Wha t is contructors doing in abstract class if we cant create object of that.....

                        regards,
                        madhoriya

                        Comment

                        • madhoriya22
                          Contributor
                          • Jul 2007
                          • 251

                          #42
                          Originally posted by JosAH
                          You must be having a bad hairday ;-) you can't return methods; DAOFactory is
                          either an abstract class or an interface. That snippet must be part of an abstract
                          factory and it returns the appropriate factory given some database indicator.

                          kind regards,

                          Jos
                          You are absolutely correct Jos.....
                          But why u people are keep guessing that what is DAOFactory....
                          I have already written that as comment in code that it is a abstract class....

                          Sorry I posted it twice......i dont know how to delete it.....as there is no option of deleting

                          Comment

                          • madhoriya22
                            Contributor
                            • Jul 2007
                            • 251

                            #43
                            Originally posted by JosAH
                            You must be having a bad hairday ;-) you can't return methods; DAOFactory is
                            either an abstract class or an interface. That snippet must be part of an abstract
                            factory and it returns the appropriate factory given some database indicator.

                            kind regards,

                            Jos
                            You are absolutely correct Jos.....
                            But why u people are keep guessing that what is DAOFactory....
                            I have already written that as comment in code that it is a abstract class....

                            Thanks and regards,
                            madhoriya

                            Comment

                            • r035198x
                              MVP
                              • Sep 2006
                              • 13225

                              #44
                              Originally posted by JosAH
                              You must be having a bad hairday ;-) you can't return methods; DAOFactory is
                              either an abstract class or an interface. That snippet must be part of an abstract
                              factory and it returns the appropriate factory given some database indicator.

                              kind regards,

                              Jos
                              I'm a good candiadate for the d word today.
                              I was going to type interface or abstract class.
                              Sorry about that.
                              @OP.I just wanted to know whether DAOFactory was an interface or an abstract class. But that doesn't matter anyway in this case.
                              I hope you've been answered?

                              Comment

                              • JosAH
                                Recognized Expert MVP
                                • Mar 2007
                                • 11453

                                #45
                                Originally posted by r035198x
                                I'm a good candiadate for the d word today.
                                I was going to type interface or abstract class.
                                Sorry about that.
                                No need to apologize; I suffer from the same dexter-sapiens syndrome too now
                                and then: my fingers start thinking for themselves and think they know better:
                                I want to type "make", my fingers type "main", I want to type "do" and my
                                fingers complete it as "double" etc. etc.

                                Silly fingers,

                                kill -9 register,

                                Java ;-)

                                Comment

                                Working...