Deepak Sagar

Greenhorn
+ Follow
since Dec 18, 2005
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 Deepak Sagar

As per statement "Main mt = new Main (12,14,14);" you are passing three int values. But in constructor, argument is considered as array.

In order to send the initialized array, can declare the int array variable and pass that array while creating the instance.



public class Main {

/** Creates a new instance of Main */
public Main(int[] num) {
int i;
int sum = 0;
for(i=0;i<num.length;i++)
{
sum += num[i];
}
System.out.println(sum);
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int []arr={12,13,14}; //Array Intialization
Main mt = new Main (arr);

}

}

Please correct me if I am wrong
please include me also in list...
deepursagar@gmail.com

Thanks & Regards,
Deepak R Sagar
Both are different.
<!ELEMENT item (#PCDATA|item)*> can include any parsed data along with other element item in it.
but in case of<!ELEMENT item (#PCDATA)*> it can only include parsed data, it cant hold any other element item in it.
it will give an error if "<" placed in side element.

please correct if iam wrong
is throw new AssertionError is correct? please explain i am not understanding assertion properly. Where it can be used..
only final can be used for local variables...
just want to add one thing.
when control goes to return part of catch, it wl go to finally. If there is return in both catch and finally, it wl take the value returned through finally. or else it will take the value returned through catch..

catch(Exception e) {
output += "2";
return "CATCH";
}

finally {
output += "3";
if(true);
return "FINALLY";
}
this wl return string "FINALLY". as there is reurn in both catch and finally.



catch(Exception e) {
output += "2";
return "CATCH";
}

finally {
output += "3";
}
it wl return string "CATCH" as there is no return in catch part.