Questions Log   C:\1passion.labs\handson_javase\QuestionsLog 2015_08_27 11_52.rtf

Q: good[Joel kass] [hjoelkass@gmail.com] [Q: 9:59 AM] 

Q: Ok[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 9:59 AM] 

Q: can hear you now[Nabil Hussein] [nick0104@hotmail.com] [Q: 9:59 AM] 

Q: cool -:)[Joel kass] [hjoelkass@gmail.com] [Q: 10:00 AM] 

Q: Instead of Collection can I use[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:16 AM] 

Q: Sure[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:16 AM] 

Audience Question: 
Q: List l = new ArrayList()[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:16 AM] [A: 10:17 AM] 
A: forwarding

Q: say: add(Object o)[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:18 AM] 

Q: Could you please explain hasNext( ) and Next() again?[Karthika Mani] [karthikacareers@gmail.com] [Q: 10:23 AM] 

Q: Is it possible that we specify the sorting order [Sharada Bandaru] [sharada.bandaru6@gmail.com] [Q: 10:32 AM] 

Q: How does overriding equals() and hashcode() method play a role here[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:33 AM] 

Q: Sang, in the previous example, do we get an exception when we try to add the second 'Three'?[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 10:34 AM] 

Q: are we done with equals and hashcode[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 10:35 AM] 

Q: as hashing algorithm has come into picture[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 10:37 AM] 

Q: yes[Sharada Bandaru] [sharada.bandaru6@gmail.com] [Q: 10:37 AM] 

Q: I hear you yes[Robert Mapes] [robertm@printnw.net] [Q: 10:37 AM] 

Audience Question: 
Q: Is there some issue with audio today?  I hae tried severl times to connect but no  audio[Scott Beeker] [sbeeker@ix.netcom.com] [Q: 10:37 AM] [A: 10:37 AM] 
A: everyone else seems to be fine

Q: can hear[Nabil Hussein] [nick0104@hotmail.com] [Q: 10:37 AM] 

Q: why does the constructore of HashSet() looks like that in the code example[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:44 AM] 

Q: can you rerun 1.3[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 10:46 AM] 

Q: yes[Joel kass] [hjoelkass@gmail.com] [Q: 10:49 AM] 

Q: Yes, thanks[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 10:50 AM] 

Q: in the first example[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:51 AM] 

Audience Question: 
Q: can we change the type from hashset to treeset or list[Sharada Bandaru] [sharada.bandaru6@gmail.com] [Q: 10:51 AM] [A: 10:52 AM] 
A: forwarding

Q: Can you explian the if loop again from 1.3 example[Mahesh Voora] [mahesh.voora@yahoo.com] [Q: 10:52 AM] 

Audience Question: 
Q: For the above Qn, Can we convert HashSet to an Array and then from Array convert back to the TreeSet[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:53 AM] [A: 10:55 AM] 
A: Yes

Audience Question: 
Q: why is there a hashmap instantiation inside the hashset constructor[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 10:55 AM] [A: 10:56 AM] 
A: Can you tell me which code?

Q: the class code for hashset[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 10:56 AM] 

Audience Question: 
Q: Why not add takes generic Obejct as parameter[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 10:18 AM] [A: 10:59 AM] 
A: Because Object does not provide desired type safety checking I want.  For example, I want to create a collection object that contains only String.  Using Object does not provide compile type checking. We are going to learn about this later in Generics.

Audience Question: 
Q: or maybe you can elaborate the internal working of hashset[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 10:58 AM] [A: 11:00 AM] 
A: It is just using Hash internally ti store elements.  

Audience Question: 
Q: question: what is the best practice when calling reference types in creating a new object? For instance, your code has Set s = new HashSet();. Is that better than saying HashSet s = new HashSet();?[Joel kass] [hjoelkass@gmail.com] [Q: 11:02 AM] [A: 11:05 AM] 
A: Yes, in general, use of interface as a referrence type is strongly recommended because of the reasons we talked about yesterday

Audience Question: 
Q: how to import all maven project under single folder like in your eclipse?[Gokul Kale] [gokulskale@gmail.com] [Q: 11:04 AM] [A: 11:06 AM] 
A: Just select "samples_maven" directory rather than a single project when you import

Audience Question: 
Q: doing same but still all seperate maven project getting imported[Gokul Kale] [gokulskale@gmail.com] [Q: 11:08 AM] [A: 11:09 AM] 
A: let me show you

Q: I have a doubt:[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 11:09 AM] 

Q: yeh thanks..[Gokul Kale] [gokulskale@gmail.com] [Q: 11:10 AM] 

Q: for a given custom class like Person[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 11:12 AM] 

Audience Question: 
Q: please do elaborate how ideally should the hashcode be created[Mudassar Hakim] [mudassar.trainer@gmail.com] [Q: 11:11 AM] [A: 11:13 AM] 
A: The easiet would be just use random number as a location

Audience Question: 
Q: Set n = new HashSet();
		n.add(3);
		n.add(2);
		n.add(1);
		System.out.println(n); Still it prints in natural order as 1 2 3[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 11:09 AM] [A: 11:14 AM] 
A: True.  It just happened to be the case.  The point is that the order is that you cannot assume HashSet provides an order

Audience Question: 
Q: how hashmap works internally?[Gokul Kale] [gokulskale@gmail.com] [Q: 11:56 AM] [A: 11:57 AM] 
A: It just uses hashing scheme internally.  :-)

Audience Question: 
Q: for those interested: how HashMap works internally, this is a great article for that and goes into the source code: http://howtodoinjava.com/2012/10/09/how-hashmap-works-in-java/[Joel kass] [hjoelkass@gmail.com] [Q: 11:57 AM] [A: 11:57 AM] 
A: forwarding...

Q: sure -:)[Joel kass] [hjoelkass@gmail.com] [Q: 11:58 AM] 

Audience Question: 
Q: explains line by line actually for major parts[Joel kass] [hjoelkass@gmail.com] [Q: 11:58 AM] [A: 11:58 AM] 
A: forwarding

Q: in case of integers if i want to sort it in descending order where do i specify it[Sharada Bandaru] [sharada.bandaru6@gmail.com] [Q: 12:09 PM] 

Q: wouldnt you use reverse after the sort?[Robert Mapes] [robertm@printnw.net] [Q: 12:11 PM] 

Q: sort and reverce[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 12:11 PM] 

Q: reversesort() ?[Gokul Kale] [gokulskale@gmail.com] [Q: 12:11 PM] 

Audience Question: 
Q: how to decide in comparator & comparable interface for implement?[Gokul Kale] [gokulskale@gmail.com] [Q: 12:13 PM] [A: 12:19 PM] 
A: http://www.javacodegeeks.com/2013/03/difference-between-comparator-and-comparable-in-java.html  explains the differenc well

Q:   public static Comparator stringComparator() {
        
        return new Comparator() {
            
            public int compare(Object o1, Object o2) {
                String s1 = (String)o1;
                String s2 = (String)o2;
                int len1 = s1.length();
                int len2 = s2.length();
                int n = Math.min(len1, len2);
                char v1[] = s1.toCharArray();
                char v2[] = s2.toCharArray();
                int pos = 0;
                
                while (n-- != 0) {
                    char c1 = v1[pos];
                    char c2 = v2[pos];
                    if (c1 != c2) {
                        return c1 - c2;
                    }
                    pos++;
                }
                return len1 - len2;
            }[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 12:42 PM] 

Audience Question: 
Q: Can you cover SWING?. It would help me a lot. Thanks[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 12:21 PM] [A: 12:43 PM] 
A: We simply do not have time for that unfortunately

Audience Question: 
Q: In Sorting-Comparator implementation of Comparator (MyComperator ) using inner class  ?[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 12:41 PM] [A: 12:43 PM] 
A: correct

Audience Question: 
Q: Do we will have time for Serialization ?[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 12:44 PM] [A: 12:44 PM] 
A: Probably not

Q: I missed[Srini Kundety] [skundety@gmail.com] [Q: 1:19 PM] 

Q: what does the this.score = value actually doe[Srini Kundety] [skundety@gmail.com] [Q: 1:19 PM] 

Audience Question: 
Q: the example you used earlier with the enumeration, has static final which means, the values can't be changed [Srini Kundety] [skundety@gmail.com] [Q: 1:18 PM] [A: 1:19 PM] 
A: Correct.  We are using it as constant value in that case.

Audience Question: 
Q: are we able to update the id like for instance if 1. touchdown, can change that a different number [Srini Kundety] [skundety@gmail.com] [Q: 1:18 PM] [A: 1:19 PM] 
A: no

Audience Question: 
Q: does[Srini Kundety] [skundety@gmail.com] [Q: 1:19 PM] [A: 1:20 PM] 
A: Just like in any other regular class, you are initializing score variable in the constructor.  Note the score is the instance variable

Audience Question: 
Q: whan I tring to run examples on STS eclipse I have an Error Error: Could not find or load main class junit.swingui.TestRunner[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 1:23 PM] [A: 1:24 PM] 
A: you are doing run as->java application? right?

Q: yes[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 1:24 PM] 

Audience Question: 
Q: whan I tring to run examples on STS eclipse I have an Error Error: Could not find or load main class junit.swingui.TestRunner[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 1:23 PM] [A: 1:25 PM] 
A: It usually means the class file was not there meaning compiation was not done.  Try RunAs->maven install first before running it

Q: ok.thanks ::)[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 1:26 PM] 

Q: concurency?[Joel kass] [hjoelkass@gmail.com] [Q: 1:33 PM] 

Q: swing[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 1:34 PM] 

Q: concurency[Joel kass] [hjoelkass@gmail.com] [Q: 1:34 PM] 

Q: Serialization.[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 1:34 PM] 

Q: Concurrency[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 1:35 PM] 

Q: oncurrency[Gokul Kale] [gokulskale@gmail.com] [Q: 1:35 PM] 

Q: concurrency[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 1:35 PM] 

Q: threding[Steven Lin] [stevlin@gmail.com] [Q: 1:35 PM] 

Q: *Concurrency[Gokul Kale] [gokulskale@gmail.com] [Q: 1:36 PM] 

Q: Threading[Roger Ramesh] [roger.m.ramesh@gmail.com] [Q: 1:36 PM] 

Q: cool -:)[Joel kass] [hjoelkass@gmail.com] [Q: 1:36 PM] 

Q: Concurrency[Robert Mapes] [robertm@printnw.net] [Q: 1:36 PM] 

Audience Question: 
Q: what email address do i send the recommendation to?[Joel kass] [hjoelkass@gmail.com] [Q: 1:37 PM] [A: 1:37 PM] 
A: support@jpassion.com

Audience Question: 
Q: will we review any of the concepts we learned the past three days?[Roger Ramesh] [roger.m.ramesh@gmail.com] [Q: 1:39 PM] [A: 1:40 PM] 
A: We probably don't have time to do that... you can ask questions on any topics however

Audience Question: 
Q: Is Threading Basics covered? Sorry, I was off for some time today. [Mahesh Voora] [mahesh.voora@yahoo.com] [Q: 1:47 PM] [A: 1:55 PM] 
A: No we have not covered threading in this codecamp

Q: hope that makes sence[Joel kass] [hjoelkass@gmail.com] [Q: 2:12 PM] 

Audience Question: 
Q: i had one idea for a usage of Annotations:creating a @Versioning annotation that would show the specific version and any issues with an annotated method/piece of code. I was wondering, could i via reflection go and find out all the annnotations that have a specific version number in a package?[Joel kass] [hjoelkass@gmail.com] [Q: 2:11 PM] [A: 2:12 PM] 
A: Yes, we are going to see how we can get the value of the annotation later on indeed

Q: kk[Joel kass] [hjoelkass@gmail.com] [Q: 2:12 PM] 

Audience Question: 
Q: I understand the signiifcance of @override but what does these annotations which we created provide? basically what funcationality[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 2:12 PM] [A: 2:14 PM] 
A: The functionality needs to be defined somewhere in the spec.  So as I sais, JAX-RS spec defines lots of annotations and describe what they should do.  And the tools and compiler when they see these annotations, they generate some code, for example.

Q: Yes Sir[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 2:16 PM] 

Q: ok[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 2:16 PM] 

Audience Question: 
Q: How compiler know what to do with annotations ? [Dmitry Sandratsky] [damka76@yahoo.com] [Q: 2:12 PM] [A: 2:16 PM] 
A: They need to be specified somewhere

Audience Question: 
Q: although for the example i just thought of, some could argue it would be tightly coupling version control with the source code[Joel kass] [hjoelkass@gmail.com] [Q: 2:13 PM] [A: 2:17 PM] 
A: Well, source version control is completely different from versioning of your class so what you are talking about makes great sense

Q: ok[Joel kass] [hjoelkass@gmail.com] [Q: 2:17 PM] 

Audience Question: 
Q: It seems the biggest usage of Annotations would be error checking and debugging, is that right?[Robert Mapes] [robertm@printnw.net] [Q: 2:13 PM] [A: 2:18 PM] 
A: No.  Annotations are used everywhere but most frequently used annotations are configurations and added functionality

Audience Question: 
Q: It seems the biggest usage of Annotations would be error checking and debugging, is that right?[Robert Mapes] [robertm@printnw.net] [Q: 2:13 PM] [A: 2:21 PM] 
A: For example, in JAX-RS, if use @Path(...) annotation on a method, it makes the method to be REST service endpoint automatically.  Without that, I would have to write lots of Java code to do the same.

Audience Question: 
Q: JavaDoc uses Annotations ?[Dmitry Sandratsky] [damka76@yahoo.com] [Q: 2:22 PM] [A: 2:22 PM] 
A: yes

Q: Is there a way to know the list of all available annotations for a class & to be more specific for a method[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 2:26 PM] 

Q: Yes[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 2:27 PM] 

Audience Question: 
Q: for values inside of an annotation, can i use an ENUM. For examplle, say we have an annotation called isBeta, could i have an enum in the class which would define various type safe options for what type of class it is, such as bussiness logic or utlitity?[Joel kass] [hjoelkass@gmail.com] [Q: 2:27 PM] [A: 2:27 PM] 
A: forwarding

Q: interesting..ty[Joel kass] [hjoelkass@gmail.com] [Q: 2:27 PM] 

Q: yes[Joel kass] [hjoelkass@gmail.com] [Q: 2:32 PM] 

Audience Question: 
Q: It will take some time for us to digest this because Java 8 is looking very much new to me. [mohan paralla] [sunny25286@gmail.com] [Q: 2:43 PM] [A: 2:45 PM] 
A: We have not touched any Java 8 features yet... (That is for tomorrow)

Audience Question: 
Q: It will take some time for us to digest this because Java 8 is looking very much new to me. [mohan paralla] [sunny25286@gmail.com] [Q: 2:43 PM] [A: 2:46 PM] 
A: But I understand what you are saying..  You will have to spend more time playing around with lab exercises.  And do the homeworks.

Q: okay sang, I hope you will support me if I stuck anywhere during lab exercises.[mohan paralla] [sunny25286@gmail.com] [Q: 2:48 PM] 

Audience Question: 
Q: okay sang, I hope you will support me if I struck anywhere during lab exercises.Thanks[mohan paralla] [sunny25286@gmail.com] [Q: 2:50 PM] [A: 2:53 PM] 
A: After the coeecamp, you can post the questions to the class alias

Q: Ready[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 3:06 PM] 

Audience Question: 
Q: with java 1.8, do we need to also specify the type argument for a new object creation? THat is, could we have written LInkedLIst <Integer> li new LinkedList()[Joel kass] [hjoelkass@gmail.com] [Q: 3:12 PM] [A: 3:13 PM] 
A: forwarding.

Q: yes[Joel kass] [hjoelkass@gmail.com] [Q: 3:13 PM] 

Q: same code as yours, just no <integer> at end.[Joel kass] [hjoelkass@gmail.com] [Q: 3:13 PM] 

Q: yes[Joel kass] [hjoelkass@gmail.com] [Q: 3:14 PM] 

Q: ty -:)[Joel kass] [hjoelkass@gmail.com] [Q: 3:14 PM] 

Q: i had heard that generics are called invariant and arrays are covariant, but what does this mean actulally?[Joel kass] [hjoelkass@gmail.com] [Q: 3:19 PM] 

Q: ok ty[Joel kass] [hjoelkass@gmail.com] [Q: 3:20 PM] 

Q: ArrayList woudl be 'covariant' because it does not allow any subtyping...List would be variant as it allows it[Joel kass] [hjoelkass@gmail.com] [Q: 3:30 PM] 

Q: on previous example[Joel kass] [hjoelkass@gmail.com] [Q: 3:30 PM] 

Q: i think i figured out the question by looking at your last example. Just wanted to confirm if i was close:[Joel kass] [hjoelkass@gmail.com] [Q: 3:30 PM] [A: 3:31 PM] 
A: Well.. wait until we talk about sub-typing...

Q: ok[Joel kass] [hjoelkass@gmail.com] [Q: 3:31 PM] 

Q: done[Joel kass] [hjoelkass@gmail.com] [Q: 3:33 PM] 

Q: a bit[Joel kass] [hjoelkass@gmail.com] [Q: 3:41 PM] 

Q: lol[Joel kass] [hjoelkass@gmail.com] [Q: 3:42 PM] 

Q: keyword?[Joel kass] [hjoelkass@gmail.com] [Q: 3:44 PM] 

Q: call it Collection2[Joel kass] [hjoelkass@gmail.com] [Q: 3:44 PM] 

Q: import[Robert Mapes] [robertm@printnw.net] [Q: 3:45 PM] 

Q: hmm[Joel kass] [hjoelkass@gmail.com] [Q: 3:45 PM] 

Q: need to import[Robert Mapes] [robertm@printnw.net] [Q: 3:45 PM] 

Q: i think i finally got this[Joel kass] [hjoelkass@gmail.com] [Q: 3:49 PM] [A: 3:49 PM] 
A: good news.. :-)

Audience Question: 
Q: regarding covariance and the such...the words themselves are confusing, the basic concepts of sub typing are easy.[Joel kass] [hjoelkass@gmail.com] [Q: 3:49 PM] [A: 3:49 PM] 
A: agree

Q: Shin which location are these recordings available[Sharada Bandaru] [sharada.bandaru6@gmail.com] [Q: 4:30 PM] 

Q: i have heard many people complain about type erasure as a bad thing. Is this an issue in your opinion?[Joel kass] [hjoelkass@gmail.com] [Q: 4:31 PM] 

Q: ok[Sharada Bandaru] [sharada.bandaru6@gmail.com] [Q: 4:31 PM] 

Q: ok[Joel kass] [hjoelkass@gmail.com] [Q: 4:31 PM] 

Q: i agree post your discussion[Joel kass] [hjoelkass@gmail.com] [Q: 4:32 PM] 

Q: Sir, later do u intend to have similar class for Design Patterns in Java[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 4:32 PM] 

Q: please do it![Joel kass] [hjoelkass@gmail.com] [Q: 4:32 PM] 

Q: for interviews they tend to ask alot about design patterns though.[Joel kass] [hjoelkass@gmail.com] [Q: 4:33 PM] 

Q: Where is the Lambda link for tomorrow?. Thanks[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 4:33 PM] 

Q: Thank u Sir.[Rajesh Venkataraman] [rajvenka@gmail.com] [Q: 4:33 PM] 

Q: Great, thanks[Carlos Irigoyen] [carlosir@bellsouth.net] [Q: 4:33 PM] 

Q: sounds great...c u tommorow...great presentation![Joel kass] [hjoelkass@gmail.com] [Q: 4:33 PM] 

Q: Thank you Mr Shin![Roger Ramesh] [roger.m.ramesh@gmail.com] [Q: 4:34 PM]