By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,034 Members | 822 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,034 IT Pros & Developers. It's quick & easy.

Java classes comments

10K+
P: 13,264
Post comments and questions on the java classes in this thread.
Dec 27 '06 #1
Share this Question
Share on Google+
50 Replies


ronverdonk
Expert 2.5K+
P: 4,258
You'd better make this thread a sticky or it will slowly, but surely, sink out of sight.

Ronald :cool:
Dec 28 '06 #2

10K+
P: 13,264
You'd better make this thread a sticky or it will slowly, but surely, sink out of sight.

Ronald :cool:

I thought of that but then the number of stickies was getting on my nerves. I've provided links in the classes that link to this thread though.
Dec 29 '06 #3

P: 37
Cant wait for the next class :D ........ really like the way your explaining things!!

Thanks!!

Carly ;)
Jan 1 '07 #4

10K+
P: 13,264
Cant wait for the next class :D ........ really like the way your explaining things!!

Thanks!!

Carly ;)
Thanks for the comments. I'll try to get the next class up tommorrow.
Jan 2 '07 #5

10K+
P: 13,264
Got delayed by having to format my computer. Expect next class in a couple of hours.
Jan 4 '07 #6

10K+
P: 13,264
Third class is finally up
Jan 5 '07 #7

Ganon11
Expert 2.5K+
P: 3,652
Ooh, in two posts!

It all looks good, r0 - I'll take a closer look during my free period today. Keep up the good work.

Also, what parts of the String class are you planning on going over?
Jan 5 '07 #8

10K+
P: 13,264
Ooh, in two posts!

It all looks good, r0 - I'll take a closer look during my free period today. Keep up the good work.

Also, what parts of the String class are you planning on going over?
In the classes I will be going over some of the most commonly used Java classes like String, ArrayList etc. The next examples I'll use will include Strings so I'll introduce how to use that class first and also look at some differences between == and .equals when comparing Strings plus a look at some of its commonly used methods. Just the basics to get one started in using Strings.

Thanks for the comments.
Jan 5 '07 #9

10K+
P: 13,264
Guys I realize that the next class is running very late. I promise to get it up by the end of this week.
Feb 1 '07 #10

P: 36
I know that JRE and JDK are products delivered under the java platform and JRE provides the libraries,JVM, and ather components necessary for running Application. JDK includes the JRE plus command-line development tools such as compilers and debugger.

But I have some questions and confusions,
1-What is the command-line?
2-what is the difference between JVM's Role and command-line's Role?
3-the debugger is the interpreter or java that launch the application and the interpreter is the JVM???So the debugger is the interpreter or the JVM?
Feb 3 '07 #11

P: 36
I don't understand why does not the following code compile ?

Expand|Select|Wrap|Line Numbers
  1. byte a = 12;
  2. a = a + 1;
Feb 3 '07 #12

P: 36
What do you mean by the Embedded keywords or literals ???
Feb 3 '07 #13

10K+
P: 13,264
I know that JRE and JDK are products delivered under the java platform and JRE provides the libraries,JVM, and ather components necessary for running Application. JDK includes the JRE plus command-line development tools such as compilers and debugger.

But I have some questions and confusions,
1-What is the command-line?
2-what is the difference between JVM's Role and command-line's Role?
3-the debugger is the interpreter or java that launch the application and the interpreter is the JVM???So the debugger is the interpreter or the JVM?
Command line is just the prompt where you run your commands like MsDos prompt. It is not part of the j.d.k kit but is part of your OS. It's just an interface for running your programs.
Feb 5 '07 #14

10K+
P: 13,264
I don't understand why does not the following code compile ?

Expand|Select|Wrap|Line Numbers
  1. byte a = 12;
  2. a = a + 1;
The + operator is not applicable to the primitive type byte. It works for numeric types starting from int upwards.
The ++ operator, however, performs an implicit type cast to int so

Expand|Select|Wrap|Line Numbers
  1.  byte a = 12; 
  2. a++;
  3.  
will compile because a is converted to int first
Feb 5 '07 #15

10K+
P: 13,264
What do you mean by the Embedded keywords or literals ???
apublics is allowed as an identifier even though it embeds the keyword public and test1 is also allowed as a keyword even though it has the literal 1 in it.
Feb 5 '07 #16

10K+
P: 13,264
Inheritance class is finally up. Just keep the comments, questions, analysis and criticisms coming here in this thread.
Feb 6 '07 #17

hirak1984
100+
P: 316
Well fine to see this new discussions on java classes.Really awaiting when it will come upto collection frameworks,struts etc.Or did you already covered the topics?
Inheritance class is finally up. Just keep the comments, questions, analysis and criticisms coming here in this thread.
Feb 12 '07 #18

10K+
P: 13,264
Well fine to see this new discussions on java classes.Really awaiting when it will come upto collection frameworks,struts etc.Or did you already covered the topics?
Not yet. Just those topics in those classes have been covered so far. Struts tutorial wasn't part of the plan but I might include it in the J2EE tutorials that I'm thinking of starting as well.
Feb 12 '07 #19

hirak1984
100+
P: 316
That will be so nice of you,and verrrry helpful for people like me.
Not yet. Just those topics in those classes have been covered so far. Struts tutorial wasn't part of the plan but I might include it in the J2EE tutorials that I'm thinking of starting as well.
Feb 12 '07 #20

100+
P: 157
Please do start J2EE tutorials too side by side with the ongoing Java tutorials if you get time r0, can't wait to read them !!!
Feb 12 '07 #21

P: 3
java classes are pureley object oriented...All help to better application development than aany other languages
Feb 14 '07 #22

10K+
P: 13,264
java classes are pureley object oriented...All help to better application development than aany other languages
Not really. Just having a class in your program does not mean that your code is object oriented. That is why Java is not purely object-oriented because you can write code that is not object oreinted with it.
Feb 14 '07 #23

100+
P: 157
java classes are pureley object oriented...All help to better application development than aany other languages
Java isn't purely an OO language because it has basic(primitive) types that are not objects,.. a trade off of purity for practicality.
Feb 14 '07 #24

10K+
P: 13,264
Java isn't purely an OO language because it has basic(primitive) types that are not objects,.. a trade off of purity for practicality.
True.

If you have a language in which evrything is an object, the language would become purely Object-Based not Object-Oriented.
Feb 14 '07 #25

100+
P: 157
True.

If you have a language in which evrything is an object, the language would become purely Object-Based not Object-Oriented.
I am a bit confused between purely Object-Based and purely OO languages. Can you elaborate please?

Is VB an Object Based language? Do we have any example of a purely OO language?
Feb 14 '07 #26

10K+
P: 13,264
I am a bit confused between purely Object-Based and purely OO languages. Can you elaborate please?

Is VB an Object Based language? Do we have any example of a purely OO language?
A purely object oriented laguage would not only support object oriented design. It would have to have some level of enforcing object oriented design concepts. I don't know whether VB is object based or not but if everything is an object then the language is object based. Smalltalk is an example of a purely object-oriented language.
Here is an article talking about these things.
Feb 14 '07 #27

100+
P: 157
A purely object oriented laguage would not only support object oriented design. It would have to have some level of enforcing object oriented design concepts. I don't know whether VB is object based or not but if everything is an object then the language is object based. Smalltalk is an example of a purely object-oriented language.
Here is an article talking about these things.
Thanks for the link r035198x. Here's another link I just came across related to this.
Feb 14 '07 #28

P: 1
Post comments and questions on the java classes in this thread.
hi i need help with something
i have
public class Name implements NameInterface
{
......
}
getting this error

C:\Program Files\Xinox Software\JCreator\MyProjects\Test1\Name.java:1: Name should be declared abstract; it does not define setName(java.lang.String,java.lang.String) in Name
class Name implements Comparable, NameInterface
^
1 error
Process completed.
Feb 16 '07 #29

10K+
P: 13,264
hi i need help with something
i have
public class Name implements NameInterface
{
......
}
getting this error

C:\Program Files\Xinox Software\JCreator\MyProjects\Test1\Name.java:1: Name should be declared abstract; it does not define setName(java.lang.String,java.lang.String) in Name
class Name implements Comparable, NameInterface
^
1 error
Process completed.
Start a new thread for this. This thread is reserved for comments to Free Java Classes thread only.
Feb 16 '07 #30

P: 17
hi... i want to learn java..how to start up... i hve got knowledge of C,C++...
now plz assist....
Feb 27 '07 #31

10K+
P: 13,264
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
Feb 27 '07 #32

100+
P: 281
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
Mar 14 '07 #33

10K+
P: 13,264
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.
Mar 14 '07 #34

10K+
P: 13,264
[font=Verdana][size=2]horace1 has done a good job with the next part of the lessons. [/size][/font]
Apr 11 '07 #35

P: 1
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
May 2 '07 #36

10K+
P: 13,264
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.
May 2 '07 #37

madhoriya22
100+
P: 252
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.......If 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
Expand|Select|Wrap|Line Numbers
  1. DAOFactory mysqlFactory = DAOFactory.getDAOFactory(DAOFactory.MYSQL);//DAOFactory is a abstract class
  2.  
  3. //method getDAOFactory() is like this:-
  4.  public static DAOFactory getDAOFactory(int whichFactory) {
  5.         switch (whichFactory) {
  6.  
  7.             case 1:
  8.             // return new OracleDAOFactory(dbSource);
  9.             case 2:
  10.             // return new SybaseDAOFactory(); 
  11.             case 3:    
  12.                 return new MySqlDAOFactory();//MySqlDAOFactory is the class implementing DAOFactory                
  13.             default:
  14.                 return null;
  15.         }
  16.     }
  17.  
aren't we creating a abstract class object(mysqlFactory) here.......
I am a bit confused here ........
Thanks,
madhoriya
Jul 24 '07 #38

10K+
P: 13,264
Hi r035198x,

Such a nice article on java basics......My question is regarding Abstract classes.......If 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
Expand|Select|Wrap|Line Numbers
  1. DAOFactory mysqlFactory = DAOFactory.getDAOFactory(DAOFactory.MYSQL);//DAOFactory is a abstract class
  2.  
  3. //method getDAOFactory() is like this:-
  4.  public static DAOFactory getDAOFactory(int whichFactory) {
  5.         switch (whichFactory) {
  6.  
  7.             case 1:
  8.             // return new OracleDAOFactory(dbSource);
  9.             case 2:
  10.             // return new SybaseDAOFactory(); 
  11.             case 3:    
  12.                 return new MySqlDAOFactory();//MySqlDAOFactory is the class implementing DAOFactory                
  13.             default:
  14.                 return null;
  15.         }
  16.     }
  17.  
aren't we creating a abstract class object(mysqlFactory) 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.
Jul 24 '07 #39

Expert 10K+
P: 11,448
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
Jul 24 '07 #40

madhoriya22
100+
P: 252
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....What is contructors doing in abstract class if we cant create object of that.....

regards,
madhoriya
Jul 24 '07 #41

madhoriya22
100+
P: 252
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
Jul 24 '07 #42

madhoriya22
100+
P: 252
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
Jul 24 '07 #43

10K+
P: 13,264
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?
Jul 24 '07 #44

Expert 10K+
P: 11,448
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 ;-)
Jul 24 '07 #45

10K+
P: 13,264
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 ;-)
And I've just moved from Vista to Fedora as well (Not that I'm complaining about the move of course).
Jul 24 '07 #46

madhoriya22
100+
P: 252
And I've just moved from Vista to Fedora as well (Not that I'm complaining about the move of course).
hi r035198x/Jos,
One question is still there to be answered....What is contructors doing in abstract class if we cant create object of that.....suggest me on that one....plzz

Thanks and regard,
madhoriya
Jul 25 '07 #47

Expert 10K+
P: 11,448
hi r035198x/Jos,
One question is still there to be answered....What is contructors doing in abstract class if we cant create object of that.....suggest me on that one....plzz

Thanks and regard,
madhoriya
You may not be able to create an instance from an abstract class, you may be
very well able to instantiate an object from a concrete subclass. A class
constructor always (implicitly) calls its superclass' constructor so an abstract
class needs at least one constructor as well.

kind regards,

Jos
Jul 25 '07 #48

10K+
P: 13,264
hi r035198x/Jos,
One question is still there to be answered....What is contructors doing in abstract class if we cant create object of that.....suggest me on that one....plzz

Thanks and regard,
madhoriya
Remember that you can call a constructor in an immediate superclass using the super keyword. So basically a constructor in an abstract class is invoked from extending classes' constructors. Note that public constructors in abstract class are not needed since only extending classes can access them
Jul 25 '07 #49

madhoriya22
100+
P: 252
Remember that you can call a constructor in an immediate superclass using the super keyword. So basically a constructor in an abstract class is invoked from extending classes' constructors. Note that public constructors in abstract class are not needed since only extending classes can access them
Thanks for ur suggestions......but still I am trying to understand it......I vil catch u later... If I have another doubts.

What happen to more discussions in free java classes.....eagerly waiting for that....

Thanks and regards,
madhoriya
Jul 25 '07 #50

50 Replies

Post your reply

Sign in to post your reply or Sign up for a free account.