Search:

Type: Posts; User: SahilKabra; Keyword(s):

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Answers
    2
    Views
    2,996

    Re: Inheriitance and Aggregation

    Inheritance is used for an IS-A relationship.
    Aggregation is used for a HAS-A relationship.

    EG:
    Cars, Scooters are vehicles. (Inheritance)

    Car has a steering, wheel etc. (Aggregation)

    In...
  2. Answers
    1
    Views
    2,854

    Re: Can we use throw alone

    Hi,
    Yes. You can use throw alone without using try catch.

    EG:
    public void foo() throws Exception {
    throw new Exception();
    }

    Throw is used to throw an exception.
    Throws is used in a...
  3. Answers
    3
    Views
    2,767

    Re: how to use valueof

    public static void main (String [] args) throws Exception {
    String number = "30";
    System.out.println(Integer.parseInt(number));
    }

    Please paste this in a java class file.
    ...
  4. Answers
    3
    Views
    2,767

    Re: how to use valueof

    Use
    Integer.parseInt("3");
    It throws an exception if the string contains an invalid number.

    Regards,
    Sahil.
  5. Answers
    1
    Views
    4,989

    Re: how can i increase heap memory?

    Hi,
    To increase the heap memory, use the following command when you execute your application:

    java -Xms32m -Xmx256m MyClassName

    In the above command,
    -Xms32m means that the minimum memory...
  6. Answers
    1
    Views
    4,720

    Re: JTable creation in swing

    Hi Venkat,
    To add data to a table dynamically, you will have to extend javax.swing.table.AbstractTableModel. In this class there is a method called getValueAt(rowIndex, colIndex). This method is a...
  7. Answers
    1
    Views
    2,831

    Re: Problem regarding FUNCTION

    Hi Heidi,
    This is my analysis:

    Take the string HEIDI.

    The first time the function will be called with
    f("HEIDI")
    Now the x.empty() will return false. So the control will call the function...
  8. Answers
    1
    Views
    2,768

    Re: Exception in thred Main Error

    Hi Ankit,
    It would have been better had you given the stack trace.
    But the problem you are facing usually occurs because of the following:-
    You may not have your classpath configured correctly....
  9. Answers
    1
    Views
    2,715

    Re: Using Collection

    Hi Gaurav0252,
    What you can do is to store all these Strings in an Array.
    Loop through the array comparing every element with every other element. You could also declare an integer array where you...
  10. Re: Programming using java, javascript, frontpage

    Hi Patkar456,
    From what you are saying what I understand is
    1. You will need an Html file that will be your front end.
    2. This HTML file will contain the Javascript.
    3. On the submit action...
  11. Answers
    3
    Views
    3,402

    Re: not platform independent

    Java by itself is not platform independant, it is the JVM which makes it platform independant. All java code runs withing the JVM and it is the JVM which interacts with the underlying OS.

    Regards,...
  12. Answers
    3
    Views
    2,993

    Re: serialization

    Implement the java.io.Serializable interface
  13. Re: Can a class in java be private, if yes what are implementations of it?

    A normal class in Java cannot be private, but an inner class can be private. Inner classes are generally used in Swings to add listeners for various components.


    Regards,
    Sahil.
  14. Answers
    1
    Views
    3,039

    Re: Help with Arrays

    In the above program, you are passing an double to function that accepts an integer value. Since double is more precise than an integer (i.e its value is greater that int) hence Java does not do an...
  15. Answers
    3
    Views
    12,515

    Re: Why Java is Platform independent

    The Java code that you compile gets converted to a form known a bytecode that is present in the .class files.
    Every OS has its own JVM. The JVM takes this bytecode and then executes the program. So...
  16. Re: difference b/w Unchecked and checked Exception

    Checked exception is an exception that you have to handle in your program.
    EG: IOException

    Unchecked exceptions are not required to be handled in the program
    EG: NullPointerException
  17. Thread: Jsp

    by SahilKabra
    Answers
    1
    Views
    3,089

    JSP Re: Jsp

    You can use custom tags for this purpose.


    Regards,
    Sahil.



    --Smile, It makes people wonder what you are thinking!!!:)
  18. Answers
    3
    Views
    2,857

    Re: Wrapper class

    For all the primitive data types we have their corresponding objects - Eg: for int we have Integer and so on. These are known as wrapper classes.

    Prior to Java 5, there were methods that accepted...
  19. Answers
    10
    Views
    25,424

    JSP Re: Why We need JSP

    JSP is used for the design of a web page and servlet is used to code the logic that is present i.e. in the MVC (Model-View-Controller) architecture, the servlet is the controller and the JSP is the...
  20. Answers
    1
    Views
    3,227

    Re: Reading from cmd

    == is a compare value by reference. String is an object. So when you use ==,
    it compares the references of the two objects ( c and "+"). To compare the values, use "+".equals(c).
    Seeing your code,...
  21. Answers
    5
    Views
    3,476

    Re: preprocessor

    The very first thing that a C compiler does is:
    It invokes the preprocessor. The function of the preprocessor is to replace all preprocessor directives with their appropriate substitution.
    ...
  22. Answers
    5
    Views
    3,476

    Re: preprocessor

    #define a 10
    print() {
    printf("%d..",a);
    }
    foo()
    {
    #undef a
    #define a 50
    }
    main()
  23. Re: Difference between interface and abstract class? are they both same

    Hi,
    An interface provides only the signatures of methods that any class implementing that interface will implement.
    An abstract class provides implementation of the common functionalities present...
  24. Answers
    1
    Views
    2,696

    Re: Objects overlapping each other

    Are you using Swing? If yes,try setting the layout to Border Layout or Flow layout. If you set it to Border Layout, add the component as frame.add(comp, BorderLayout.NORTH) and frame.add(comp2,...
  25. Answers
    5
    Views
    3,476

    Re: preprocessor

    Hi,
    The preprocessor is invoked by the compiler as the first phase in the translation process. The preprocessor replaces all occurrences of the macro with the value. In the above program the second...
Results 1 to 25 of 42
Page 1 of 2 1 2
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact