« first day (2821 days earlier)      last day (2123 days later) » 

12:00 AM
"Plant your own garden and decorate your own soul, instead of waiting for someone to bring you flowers." -Veronica A. Shoffstall (source)
 
12:50 AM
hi
 
@Nosrep 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
 
ok
my jar files aren't launching
 
1:06 AM
Oakbot is a chatbot!!!
/help
 
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.
/ej        Displays items from the book "Effective Java, Third Edition" by Joshua Bloch.
/fatcat    Displays a random fat cat.
/groot     I am Groot.
/help      Displays this help message.
/http      Displays information about HTTP status codes and methods.
 
/fatcat/fatcat/fatcat/cat/cat/cat
/fatcat
 
/cat
 
1:13 AM
failures
 
 
6 hours later…
7:13 AM
farts
 
faints
 
Zoe
7:59 AM
morning
 
user8622974
morning
 
Morning.
 
8:39 AM
afternoon
no bots are wishing... there is a bug
 
Zoe
//time in the Java room on Stack Overflow
 
user8622974
@Zoe Morning
 
8:58 AM
SO to go into read only mode soon
 
 
2 hours later…
10:29 AM
I am using Sublime Text 3 (I know there are intelligent IDEs out there but for my OCA preparation I need Sublime ). I would like to "store" System.out.println() somewhere so that when I type sout and pess ctrl + tab it brings out System.out.println(). How can I achieve this? Is there a plugin for this?
 
Zoe
use a Logger instead
logger.properties lets you define a file to output anything the logger prints
you could also use a logging library if you prefer, but Java has a Logger class too
 
Either way I think they are asking for creating shortcuts for code snippets..
 
Zoe
oh. Nvm
saw "store System.out.println" and thought it was for logging purposes. Nvm ^^"
 
10:54 AM
@SurajRao Yes, that is it thanks. Yeah, creating shortcuts for code snippet not really storing :D
 
 
1 hour later…
12:00 PM
Fish use a variety of low-pitched sounds to convey messages to each other. They moan, grunt, croak, boom, hiss, whistle, creak, shriek, and wail. They rattle their bones and gnash their teeth. However, fish do not have vocal chords. They use other parts of their bodies to make noises, such as vibrating muscles against their swim bladder. (source)
 
 
3 hours later…
3:16 PM
hi
 
hi guys
 
@GoldShovel 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
 
im new to this!!
first time here.
 
Zoe
o/
 
\o
 
user8622974
3:25 PM
\o
 
6:03 PM
\o...
 
6:15 PM
Objection!
 
Zoe
6:41 PM
Err: Class 'Objection' not found
 
Error: Class 'Err' not found
 
Zoe
Err: Label 'Error' can not be applied to 'Class'
Ew -> parser.<K, V>parse(data);
 
7:23 PM
Error: Either you are not logged in or you do not have the appropriate privileges to perform this action.
 
Zoe
7:35 PM
Err: Failed to handle PrivilegeDeniedAction. Ignoring and performing the action
 
7:50 PM
I have a quick question regarding Super and Sub classes. If say I have a Getter or Setter within my sub class. How would I go about using a Getter or Setter from my Main Method. Ex. Within the Main [ Object.setName(); ] // Within the sub class [ this.name = name; ] But what happens is ( setName() ) portion does not exist in the main method do to it being part of the Sub class and not the Super. How do I go about using these methods within my Sub classes?
 
@Twissted 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
 
Zoe
//mcve Twissted
 
user8622974
Please create an MCVE @Twissted
 
In this situation the main argument piece of code does not work because it does not exist as an option. How do I go about accessing this setter in the child class?
Is this even possible?
 
Zoe
does Parent have a setName method?
 
8:03 PM
No
Does it need one? and then an @override or something of that nature?
 
Zoe
It doesn't, but you can't access a method that exists in the child, but not in the parent, when you have a field of the type Parent
Parent something = ...; something.setName(""); isn't valid, since Parent doesn't have a setName class. Child something = ...; something.setName(""); is valid though
 
So if I have a bunch of variables for different subclasses that are unrelated to the Parent it would require me to create these variables regardless within the Parent class?
 
Zoe
and that's regardless of which type you actually initialize with Parent something = new Child(...); something.setName(""); isn't allowed, since the type you declare is Parent. Which it actually is an instance of doesn't matter.
 
Java is so confusing...
 
Zoe
Similarily, saying Object something = new Child(...); something.methodInChildButNotInObject();isn't allowed either. If you're declaring the supertype as the field type, the superclass has to contain the method you're trying to call
you can also cast the instance to get access
@Twissted Or use an instance that has a type that matches the child class
 
8:10 PM
If you don't mind taking a look at this code. This is currently what I am working on. I want to be able to set the Elves best friend.
I also have sub classes including Hobbits, and Wizards
What casting the instance
I'll google it
 
Zoe
Either do Elves elves = ...; elves.setBestFriend(...) or ((Elves) Camran).setBestFriend()
 
Ok, but if I use Elves elves. Would this not result in the Humanoid class being irrelevant?
Because in order to use a toString() method I would need to save all of these variables within the Elves class resulting in extra code
I'll look at the second portion
Okay so this second portion of Code ( ( Elves ) Camran ).setBestFriend works. But why is this. Because this is what I want to do is be able to access these getters and setters and bypass the Humanoid parent class
((Class).Object).method() ?
I appreciate your help by the way. This little snippet of code is what I've been trying to figure out for the past hour. :)
 
Zoe
Field declaration requires a type (since Java has type safety; A string is a String, not an int, etc). This means when you declare a `Parent parent`, that means you get access to the fields of the parent. If you do `Parent parent = new Child()` you can still only access the fields and methods declared in `Parent`, because that's the defined type. Regardless of how you initialize it (with an instance of Parent or an instance of a child class), if the type of the field you're using is `Parent`, you can't access the fields of i.e. `Child`.
 
@Twissted Why are the class names of varying plurality?
 
Lol I don't know, I can change that if it bugs you
It makes sense that it should be singular though
I think that makes some sense to me, I understand the not being able to access portion. It just sort of breaks my brain trying to understand the accessing these methods, declaring objects, etc. Again thank you for your time
 
8:50 PM
I think this is much better: paste.ofcode.org/7j2Z26BPvSvq7Jxm7sdVTX
 
9:01 PM
What did you do? Just clean up my indenting and such? And what is foo?
I always seem to have fairly messy code and clean it up as I finish a section
 

« first day (2821 days earlier)      last day (2123 days later) »