Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

dorel iancu

Greenhorn
+ Follow
since Oct 13, 2017
Indy
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by dorel iancu

Hi,
Thank you all for the input.
I read what you said several times and I think I came to some understanding:
- checked exceptions should be used whenever there is reason to believe that the app can recover from those exceptions.
- runtime exceptions are not bad actually since they may point to a programming error
- handle runtime exceptions if you want but don't overuse them.

Hope that makes some sense.
Thank you all again and have a good weekend.
1 month ago
Hi,

I am kind of confused about usage of checked exceptions; I looked them up on the web and on this site and I got more confused.
Anyway, my thought: I can handle an exception (try/ catch) at runtime. All exceptions I can think about... and I can catch them right where they may happen.
So, why would I use a checked exception ever ?
NB: I am currently learning Java; as far as I know C# does not use checked exceptions.
Thank you.
1 month ago
Now, that was fast and crystal clear !
Thank you all, so much !
4 months ago
Hi,
This is kind of stupid question and I could not find a clear answer to my problem. Here is where my confusion is coming from:
I know that in a .java file there can be only one top public class and the file name needs to have the name of that public class (say MyPublicClass.java). Now, I have more than one class in that .java and there is interaction between all of them (eg an instance of a class may call a method in a different class).
When I compile that .java, the compiler will create a separate .class file for each of those classes... and I do 'java MyPublicClass' to run my lousy code     .
So, I wonder, if I want to have all those classes public (not sure why), I have to create a .java file for each of them and compile then separately, how else ?
How can I compile all those .java files and how to I run my code ('java ...') by calling only one of them so all of them would run like a unit ? or,  how is it really done ?

Thank you for your patience and have a good weekend (since it's Friday eve today     )
4 months ago
... Just wow !
Well, as they say: 'be careful what you wish for'  
On a serious note: the above are the most/ very comprehensive  explanations I ever got for anything. Awesome.
I got a lot of knowledge from you guys and of course other questions which I intend to solve by my own.
Thank you so (very) much !
6 months ago
First of all, thank you very much for your answer Bryson.
Still, I have two questions (..sorry    ):
- why Java seems to be more  popular than C# ?
- in the C#, your 'Hello world' construct, the Main method is listed as public.
I used C# to create some test tools I needed when I had a job and I really like C# but I still have a lot to learn. So, long story short: why would I need to make Main() public in C# ? From all I saw and use, Main() was always private.
I realize that these questions are kind of time waste for which I apologize.
Before I go I really need to say this: this 'Ranch' is awesome. Really.
Thank you.
6 months ago
Thank you.
So, the main difference between C# and Java is the fact that Java runs on a virtual machine. Isn't this making Java slower ?
However, Java seems to be more popular and versatile than C# so there may be other reasons as well. Wonder what Bryson Paine would say about this.
Thank you,
6 months ago
Hi,
Not sure I'm in the right place for Bryson Paine's book promotion.
I got a question though: I am familiar with C# and new to Java. They look pretty similar syntax- wise. So, aside of Java running on a JVM, what would be the main difference(s) between C# and Java ?
Thank you.
6 months ago