« first day (2407 days earlier)      last day (2528 days later) » 

11:00 AM
I don't know
 
a HashMap signature looks like follows: HashMap<K,V> and .values() returns Collection<V>
 
Yes
So it will contain the Values
Cool
 
since your HashMap is declared like this: HashMap <String, Object> index K: String, V: Object
so your Collection will contain Object
due to the fact that .values returns a Collection which implements Iterable we can use it in a short for loop
 
So, if I'm asked to add another book, would this be correct?: index.put("Justin Bieber");
@motaa Haven't I already done that?
 
that will look like: for ( Object book : index.values()) {}
no since your are missing the second parameter
 
11:06 AM
wait, so I replace the for loop in my code with that?
 
adding another book to your HashMap would look like this: index.put("Justin B." , new Book("Beep Book", new String[] { "Justin B." }, 20.00);)
 
Flying cars aren't so crazy after all
 
Ohh I see @motaa
@Julo0sS Cool
 
yeah that's pretty cool
maybe we will never really see it, but thats cool, that sounds like back to the future :P
"Where we're going, we don't need roads"
 
11:10 AM
index.put("Justin Bieber", new String[]{"Justin Bieber"}, 11.00, new Location(1500, 10));
This red-lines the word "put"
 
Top of the morning, I say!
 
morning's gone for a while now :P
 
@motaa Never Mind, I fixed it
 
well it's funny :D
let the code run
I bet you get an exception :D
 
it doesn't make sense
it runs perfectly
 
11:17 AM
@CrashBandicoot I stopped reading when I saw Justin Bieber.
 
but it gives the same output as if there was no HashMap
 
how often do you add Justin Bieber?
 
A compiler should explode when this pattern is detected. :)
 
@PauloCereda +1
every time you iterate over your array to fill your hashmap you add/override the old Justin Bieber
 
11:20 AM
It's not working :(
 
@CrashBandicoot take a look at that paste.ofcode.org/WXLTE6q7QTGrVLuwTHg3TD
 
Hmm okay
But Line 45 is red-lined
 
what does the compiler say?
 
Duplicate local variable book
 
paste your code
 
11:24 AM
Line 44 "object" is errored
I think just renaming it fixes it
Yeah, it works when I rename it to "books"
 
wait I am reformatting that code
it's a pain in the butt with that idention
take another look again pls... you need a seperate loop
 
it's not
 
Is the clone of Justin Bieber the wrong part?
One of the questions is to try and create a same key to see what happens
For some reason, it doesn't bring back any errors
 
Clone of Justin Bieber... import static va.vatican.blessings.HolyWater;
 
11:31 AM
HAHAHA xD
@motaa Any Updates?
 
What was changed?
 
hello
 
the indention
 
QUACK!@PauloCereda
 
11:47 AM
@motaa Shouldn't the output be "book" 3 times followed by JB?
Shouldn't line 47 bring back an error
Since I've created a duplicate Key in a HashMap...?
 
no
 
Hey @Hans1984
 
hey@Joe'sMorgue
 
The question asks: "Try adding a book with a title that already exists in the HashMap. What happens?"
 
11:55 AM
/javadoc HashMap#put(K, V)
 
@motaa Sorry, I never heard of that class. :(
I couldn't find a signature with those parameters. Did you mean this one? (type the number)
1. java.util.HashMap#put(Object, Object)
 
anyways under the put() method it is stated that "Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced."
 
1
 
@motaa Ohhh I see
So essentially, the 1st Justin Bieber titled book gets replaced by the 2nd one?
 
yep
I would recommend you that you rephrase your signature for your HashMap
into sth like this: HashMap <String, Book> index = new HashMap<String, Book>();
in that case you could write:`for(Book book : index.values()){
System.out.println(book.toString());
}`
and don't need the cast from Object to Book
got that @CrashBandicoot
 
12:09 PM
where did the duck go?
/8ball quack quack ?
 
@Hans1984 Most likely
 
 
1 hour later…
1:10 PM
@motaa Thanks!
What difference does it make?
 
1:26 PM
it is about everything in java beeing an Object
 
Happy Friday, Java!
 
hey@Michael
 
Hey@Hans
 
Hi guys
tomorrow we start Ramadane :D
fasting in the summer + computer science ===> struggling life
 
1:48 PM
@Sayros just switch religions!
boom, problem solved!
 
lol or stay without religion it's more better
 
baha yeah
Although Hinduism and Buddhism aren't too bad
The true peaceful religions :P lol
 
@Sayros How many hours are you fasting?
 
@CrashBandicoot I believe it's sun-up to sun-down for a full lunar month
 
Yeah, just want to know how many hours in his country
 
1:50 PM
ah
 
Over here it'll be ~19 Hours without food/water
 
Hello fellow java companions, this is my first time on this chat
 
in 20C+ Temperature
 
@JamesP. Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
from the dawn till the sunset @CrashBandicoot
 
1:51 PM
@CrashBandicoot Are you muslim? Where do you live?
 
Yeah, I'm a Muslim
London
 
England?
 
@Sayros I know, but how long is it in your country... xD
@ballBreaker yeah
 
I always have to clarify since there's a london in Ontario lol
 
Why did oakboat tell me this "
@JamesP. Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D"
 
1:52 PM
in the summer it will be approximatly 16 hours
 
@JamesP. OakBot is a Bot that gives this info to new joiners to this chatroom
 
@CrashBandicoot sometimes 17 hours
 
Oh okay. Why did the robot say Android questions are for else where? I thought Java was the language of android devices?
 
There's another chat room called Java & Android
 
@crashbandicoo
Where do I find the code snippet tool button?
Thanks @crashbandicoo
 
1:54 PM
Save it as a bookmark
You're welcome @JamesP.
 
@crashbandicoo thank you much
 
@JamesP. if you use java grammar like Collections, java.lang you can ask your question even you re android
 
A difficult part is the night prayer
 
however if you ask for layout, and android stuff No => go to android chat room
 
I've taken some time off of work, to make it easier
 
1:56 PM
@CrashBandicoot good if you re a muslim
 
@Sayors Yeah
Gonna have to go night prayer today
 
@CrashBandicoot I think your mother Or Father (or both) are muslim
 
@sayros Thanks. I am new to programming, I am just finishing chapter 6 in Starting Out with Java by Tony Gaddis. I am starting Arrays. The first language I am starting with is Java. I do not yet know anything about android
 
so one of them his origin is Arabic no ? @CrashBandicoot
 
1:57 PM
@JamesP. We are on the same boat then
Java is my first programming language and I only started recently
 
@sayros I do not know what a java grammar like collections, java.lang is
 
@Sayors No
 
humdallah
 
@James I'm sure you'll cover them soon
??
 
I think it means thank god. I have a friend that speaks arabic
 
1:58 PM
@CrashBandicoot Ah okay
 
You're right, not spelled correctly though
 
@JamesP. yes it' is
 
Yeah, she is a cool person. Her sister knows all the islamic stories. She told me one called The Curse of the Eye or something
idk how to spell any of it
 
hummm
 
Yall know anything about the Oracle Java associate certificate?
 
2:01 PM
it's a certificate
 
@crash
@CrashBandicoot how does this URL link work for code?
@sayros have you ever taken it?
 
That's HTML?
 
Yeah
 
@JamesP. I have OCE web component
 
I don't know HTML
 
2:03 PM
@CrashBandicoot I am trying to use the link you sent me paste.ofcode.org/36FVTRZhWdrSxgy9XiEb8Cz
 
@Sayros Did you do that by yourself?
 
I thought it was suppose to format your code
 
@JamesP. Type the code into the pasteofcode
select Java
Press the Paste button
then copy and send the link
 
yes by myself
 
2:04 PM
@Sayros How much did it cost?
 
@CrashBandicoot OHHH, I was copying the code. Not the link. Oops
thanks
 
the training i dunno because I prepared it by myself, howver, the exam it costs 150 Dollar if I remember
 
what is an OCE web component
245 Now i think
 
@Sayros Would you recommend someone to get that?
 
you can check from Oracle website
 
2:05 PM
This is the exam I would like to take education.oracle.com/pls/web_prod-plq-dad/…
 
How long does it take to prepare for these certificates?
 
I don't recommend if you re not good in JAVA
if you have an experience in JAVA you can pass it , and doesn't means you cannot pass it if you dont have experince
 
@Sayros Just not good yet
 
In my opinion certificate without experience ==> nothing for me
 
@sayros what is this youracclaim site?
@sayros
 
2:07 PM
contains my two certificates
couldn't open it ?
 
@sayros I have heard the same thing, experience > certificates. However, I am trying to transition laterally from the laboratory (chemist) to software
I can open it. What is the site? Did you build the site?
 
No
 
@CrashBandicoot Why are you learning Java?
@sayros
 
when you get a certificate from Oracle, Oracle will build a badge for you
 
@Sayros *Why are your certificates listed there?
@Sayros Oh, so that is like the proof of completion?
 
2:09 PM
you can refer to them from linkedIn for example
 
@JamesP. I'm a Developer in Training
And Java is one of the programming languages I will have to use
Along with others
So, I have to learn it
 
Oh nice, thanks for the heads up. So you have one in web technologies using java? What is that, like .war files?
@CrashBandicoot Nice, are you studying at any universities or are you teaching yourself? Do you work anywhere?
 
Well, studying at university and working
And teaching myself too
 
@sayros I have not yet been able to find out how to get my java code to work anywhere but in a software application called jGRASP
/all
 
btw @JamesP. You can interact with the Bot
/help
 
2:13 PM
Commands=====================
/8ball     Simulates a magic 8-ball.
/about     Displays information about this bot.
/afk       Allows users to mark themselves as "away".
/cat       Displays a random cat picture. :3
/define    Displays word definitions from the dictionary.
/help      Displays this help message.
/http      Displays information about HTTP status codes and methods.
/javadoc   Displays class documentation from the Javadocs.
/learn     Teaches the bot a new command.
/react     Displays a reaction gif.
 
/help
/8ball
 
@JamesP. Ask again later
 
/8ball whats up
 
@JamesP. Very doubtful
 
2:13 PM
can yall see these messages about an 8ball?
 
wtf lol
is there any command for finding out all users in a chat?
 
It's all on the side
 
@coldfire
@codeln
 
2:14 PM
Don't do that, unless you're referring to them xD
 
Where are they? In other chats?
 
Probably just inactive
@James Are you going to uni?
 
I dont really like the UI in this chat lol
@CrashBandicoot I am taking a few online classes from a community college about an hour from my hometown, but no university
I am mostly just reading books
I am learning Oracle 12c; SQL very intensely at the moment, I want to take this exam also education.oracle.com/pls/web_prod-plq-dad/…
I am starting out with Java, learning all the tools of OOP languages, such as loops, iterators, if-else ect.
Ive taught myself HTML and CSS decently, and am starting with bootstrap Twitter
I am starting to use the OOP tools ive learned from java, to learn Javascript and jquery
 
How old are you if I may ask?
 
25
 
2:18 PM
Ohhh
So you've done uni?
 
Yes, I have a bachelors in chemistry from unc-chapel hill
the laboratory sucks though
and the pay is horrible
 
Are you a doctor?
 
I want to learn PHP, but ive been told it isnt as indemand as javascript combined with mysql
no, not doctor. That requires a Ph.D
or an MD
I have a BS
I want to learn SAS the statistical programing langauge
@Sayros can you teach me how to deploy war files in docker?
@Sayros please
 
I thought Java is one of the most demanding languages?
 
That is what i've been told also
Ive also been told that SQL is next in demand
followed by a quickly rising Javascript
Which university do you study at?
 
2:26 PM
I'm from London
 
oh nice
mate
 
Yeah
Where are you from?
 
america
@Sayros can you teach me how to deploy war files in docker?
 
1 message moved to friendly bin
@JamesP. Please use a code snippet tool when posting code.
 
@Michael
Could you review my code?
It's short
 
2:28 PM
Post it
@Michael My bad, thank you
@CrashBandicoot Post the java code snippet tool
 
Why do I have so many compiler errors?
 
dunno lol
 
1 message moved to Trash
 
how do you move a message to trash?
 
2:34 PM
@JamesP. please use pastie.org or hastebin.com to paste code snippets
@JamesP. Only a Room Owner can move messages from one room to another
 
I post the URL
 
@CrashBandicoot are those import statements from the Java JDK?
 
yes
I think so
 
haha oops, i accidentally pasted your code twice
what about this import library.location.Location;
import library.model.Book;. what is this?
why do you have location.location twice?
The java api has a class called book? lol
Does it compile for you crash?
 
2:45 PM
These are from the JDK

> import java.util.ArrayList;
> import java.util.HashMap;

These are not from the JDK:

> import library.location.Location;
> import library.model.Book;
 
Ohh I see xD
 
"makes sense now" :D
 
xD
motaa, my code is good now right?
 
@CrashBandicoot Because the location and book are not from the JDK, I can't correctly compile your code without the other class files
 
@James Yeah
I just wanted to know if the code makes sense
 
2:48 PM
It looks really clean
Ive never seen a for statement like that
I have not gotten to chapter 7, arrays yet
 
@CrashBandicoot in your previous code like stated here paste.ofcode.org/392nprFXSnPQffE8mZ8QRqF you had a loop inside your loop.
 
@motaa is that a bad thing? I do that all the time
@motaa but i also dont know much about java
 
@motaa So how should I change that?
 
not in this case because during every iteration over his array to actually fill the HashMap he iterates through the map which does not make sense. In that small block of code he wants to fill the Map so let the code do that
 
what is a map?
 
2:52 PM
you change it by closing the first loop and after that you iterate over your just filled map
 
map=HashMap
 
paste.ofcode.org/F4H6GcfN57VRyA8ppHy34b you have 4 Loops in you file that follow after another
 
what is a hashmap?
 
@Hans1984 he is trolling I guess :D
 
what is trolling?
lol im not kidding
 
2:53 PM
someone push this guys reset button
i think hes stuck
 
@motaa So, do I need to change anything?
 
trolling is like pretending? im not pretending. I dont know what a hashmap is
 
Trolling is where you hide under a bridge
 
hahaha@Joe'sMorgue
good point
 
show me your last code @CrashBandicoot
 
haha yall are crazy, i have no idea what you're talking about
 
@CrashBandicoot that code looks good
 
@motaa Was getting scared for a second xD
Almost at the end of the exercise
The next exercise says:
We can also use the object itself as the key in a Hashmap. Create a second HashMap that uses the book as the key and its title for value.
Do some research and find out what iterators are. Then use an iterator to iterate around the collection and print the details of each book.
 
Good job crashbandicoot
 
I've created the second HashMap, as you can see
 
2:57 PM
I know what iterators are. They are like counters
 
But, with the iteration, would it be the same as the 1st HashMap?
 
@CrashBandicoot Can you share your resources with me? Where are these exercises?
I only use books
 
@ItachiUchiha get your url's fixed :P
 
@JamesP. It's exercises given to me by the training providers
Not sure if I can send them out tbh
 
3:00 PM
Nice, who are your trainers?
 
@ItachiUchiha Those aren't even the best ones
 
You won't know them xD
 
It's okay.
 
!!> Math.max()
 
@MadaraUchiha "-Infinity"
 
3:00 PM
@ItachiUchiha ^
!!> [10, 10, 10, 10].map(parseInt)
 
@MadaraUchiha [10,"NaN",2,3]
 
@CrashBandicoot thanks anyways. I havent read array's yet
Is it possible to save user profiles?
 
@JamesP. You're probably better than me at Java
No lie.
@motaa I've been asked to iterate over the second HashMap
Would I use the same method as the first HashMap?
 
@CrashBandicoot I'm reading a book called "Starting out with Java, From Control Structures through Objects" 5th ed. by Tony Gaddis.
 
I'd suggest reading the book 'Head First Java'
 
3:02 PM
I know nothing about programming, and this book starts from the very start
 
This one starts from basics too, as far as I know
 
wow. thanks bud
I had to buy the java 7 version of this book because the 8 version was way too expensive
 
No worries
 
Good luck to you Crash. I am off to the east coast of america for holiday
 
Nice @JamesP.
Enjoy
 
3:04 PM
@JamesP. you won't be needing the j8 version of it... basics didn't change and for any new j8 stuff you got tons of other resources
 
@motaa good. Ivve been worried i am missing out. This old edition was like 150$ cheaper
Thanks yall, enjoy the weekend
 
@James you too
 
is it possible to "follow" users on stack?
or friend request them
 
@MadaraUchiha o.O
 
Oh, i think that is git hub
idk
 
3:09 PM
@JamesP. No
 
@ItachiUchiha All of those have good explanations btw
 
bye
 
3:25 PM
@Hans Bye
 
See ya
 
 
4 hours later…
7:59 PM
Is the chat broken, or is it just really quiet?
 

« first day (2407 days earlier)      last day (2528 days later) »