This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Shashank Mittal

Greenhorn
+ Follow
since Nov 30, 2009
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shashank Mittal

Thanks for replies man, but in general Java books, why they are covered way after traversal of key concepts, thats still unknown to my limited intelligence.
thanks again, scanner one is really a cool one!
12 years ago
Its surprising that after reading almost the whole book, . . . Guys Is there any simplest way to get the input in java, such that I can add 2 strings, numbers by taking command line input from user.
There is only one way I know,
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

This clicks me as somewhat odd way of taking input. Guys I have recently moved from C/C++ to Java, and I was expecting the input taking mechanism to be butterly simple, but the above statement horrified me badly. We learn in 2-3rd chapter in C/C++ "How to take input" and in Java why is it such lately introduced in almost all the books?


Thanks
12 years ago
well said FRED!
Thanks for that great TIP. I will take care of it next time. Really!
12 years ago
Thanks Wouter

Any good books you can refer, by good books, I really mean good books for a silly person like me! :P
Thanks again main...errr....man!!
12 years ago
OUCH!!!
Thank you!
But I seem to have this frequent problem.
whenever I call anyother variable in Soprintln, it says can;t reference from non static context.
I have to declare the variable as static, is there anyway to override this problem.
Thanks again
12 years ago
Thats my code guys.



And attached is the error thrown at compile time.


Please help me Guys!! I am frustrated as well belittled by my own class fellows
12 years ago

A constructor can only call its super() as the first line of the constructor -- you will get a compiler error at any other time.
And no, you can't call super in the static initializer.



Yeah man, I am saying I have inserted a static block inside the abstract class, and I am calling super from first line

If you are able to get the compiler to core dump, then you should submit a bug report to Sun.


Will that help?

Regardless, how is one constructor calling another constructor "triggered" a call? All it does is have a constructor calls its super, something that is very common. It doesn't mean that an instance is created magically


thats the problem man, if the abstract class can't be instantiated then at the runtime how can we make it run with the help of another abstract class, you know, the OTHERWAY! :P
Sorry If I sound way too confusing.
12 years ago

Henry Wong wrote:

Don't know what you mean by "interwoven" or "started yielding results", Care to elaborate?

Henry


By interwoven, I mean that can we have such arrangement in between the two class's constructors, such that they could be triggered, if yes how (note that, both classes are abstract!). I tried using super keyword also tried declaring a static block inside the class, but of no use. Still confused.

a Java developer would hate to core


Compiler crashes! Now don't scold me for using notepad and not Eclipse or Netbeans! Please, I am well and good with textpad. IDEs look quite scary.
12 years ago
Hello all,
Actually I came across a weird question thrown at us by my project manager, that what if we extend an abstract class with another abstract class? What would be the result? Can their constructor could be interwoven in such a way that the object creation is not needed at all?
I tried it back home and it started yielding results, a Java developer would hate to core.
Where he was getting at, I am still clueless? Please help anyone?
12 years ago