Search:

Type: Posts; User: American

Search: Search took 0.26 seconds.

  1. Replies
    3
    Views
    494

    Re: checking for empty strings?

    This is a better code than mine. But mine would work too. Thanks for showing an aliter.
  2. Replies
    3
    Views
    494

    Re: checking for empty strings?

    You need to use try, catch blocks for this.

    public static void main(String[] args) throws InputMismatchException
    { boolean flag = true;
    int i;
    Scanner j = new...
  3. Replies
    1
    Views
    715

    Re: Format Problems

    public static void main(String[] args)
    {
    // Assign Variables
    double meter = 0;
    double foot = 0;
    double x;
    double y;

    //Header for meters...
  4. Replies
    3
    Views
    3,608

    Re: Address of String instance

    I wanted to know the address for the reason that :

    String s1=new String("Hi");
    String s2=new String("Hi");
    System.out.print(s1==s2);// false
    s1=s2;
    System.out.print(s1==s2);// true

    I...
  5. Replies
    3
    Views
    3,608

    Address of String instance

    AClass c=new AClass(“Hi”);
    System.out.print(c);// here it prints the address of object c
    String s=new String(“Hi”);
    System.out.print(s);// here it prints Hi. But I need the address of s.


    Can...
  6. Thread: Silly error

    by American
    Replies
    5
    Views
    534

    Re: Silly error

    Thanks to you all. Interesting....
  7. Thread: Silly error

    by American
    Replies
    5
    Views
    534

    Silly error

    System.out.println(2.6%1.1)// gives 0.39999999999
    System.out.printf("%f",2.6%1.1)//gives 0.40000000

    Anyone know why ?
Results 1 to 7 of 7