sai panindra

Greenhorn
+ Follow
since Jan 06, 2009
Merit badge: grant badges
For More
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 sai panindra

Hi People

I have an idea for a task tracker app which would help users to track their tasks .Users click the executable, it'd open on the desktop and they start interacting with it.

I believe I have a fair idea of java programming language. I have cleared the SCJP a few months back. Dont' have the experience in application development in java though.

My question is , Is it a good idea to start with the app? or would i be hit by so many road blocks that I may be demotivated to even learn the technology moving forward?
Is it a good idea rather to go with the traditional method of going through the text books and working out the exercises? (I feel this takes a long time and in the end we get to cover only a minor part of the technology like core java for example).



12 years ago
// in file base.java
package p1;
import java.io.*;
import java.util.*;


public class base
{
int n=1;
public int n1=3;
public base()
{
System.out.println("fdfs"+n1);
}

public static void main(String args[])
{
base obj=new base();
}
}

// in file derived.java

package p1;
import java.io.*;
public class derived extends base
{
derived()
{
System.out.println("asfsdf"+n1);
}
public static void main(String args[])
{
derived obj1=new derived();
}
}


i put both the files in a folder named p1.
compiled the base.java successfully.
When i try compiling derived.java, it shows an error stating that it cannot find symbol "base".
Please tell me the reason for this..

Thanks
14 years ago
class A{
public void test(){System.out.print("test");}}
class B extends A{
public void test() throws RuntimeException{
if(true) throw new RuntimeException();
}

The above two classes compile fine. But when I replace RuntimeException with IOException , it throws a compilation error saying that overridden method test does not throw IOException. Then how does it work with the Runtime Exception?
14 years ago
Class A{

int aVar;

public A(int a){aVar=a;}

}

class B extends A{

int bVar;

public B(int b){

// super(10);

bVar=b;
}

public static void main(String[] args){

B b=new B(2);
}
}

In the above case, there 's a compilation error stating that the contructor A() is not present. But when I uncomment the line super(10).. the program compiles..

Please explain how this is a compilation error but not a runtime error. I presume that when a class extends another class, a super() call is made to the no arg constructor

unless another parameterized constructor of the super class is explicitly called. But I think this is known only during execution time
14 years ago
If an object is referred to by a reference variable which itself is inside another object in the heap, then is this object eligible for garbage collection?
The former object is not referred to by any other reference variable...
14 years ago