Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!

Nayanjyoti Talukdar

Ranch Hand
+ Follow
since Feb 12, 2002
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 Nayanjyoti Talukdar

Hi,
Can anyone please tell me the relationship between Portlet and Web Service? Any suggestion for Portlet development tutorial?
Regards
Nayan
18 years ago
There is no any direct implementation in API.
U can do that using GregorianCalendar.
----------
Nayan
18 years ago
I suggest to convert both the object to Date object. Date class implements Comparable interface which has a method called compareTo(Object o). Using the method, one can compare two Date object.
--------------
Nayan
18 years ago


1. int i=0;
2. i=i++;
3. System.out.println(i); //print out 0


i is initialized to 0 before it gets incremented to 1.
--------------
Nayan


class X {
public static void main(String[] args) {
int i = 0;
while (i++ < args.length) {
System.out.print(args[i]);
}
}
}


Here is the explanation:
Inside the while loop, the conditional part is i++ < args.length. i.e
i=i+1(but this is a postfix operator).So for the first execution of while loop, the value of i=0 but the value becomes 1 after that conditional part. Like this, whenever i value reaches to 5, after post fix operation, the value becomes 6 inside the while loop. if u try to get the value of args[6],compiler will throws ArrayIndexOutOfBoundException (Subclass of RuntimeException).
If you use while(++i<args.length), then the output will be BCDEF.
----------------
Nayan


Normally, these are both the console, but as shown in the above example it doesn't have to be.


what do u mean by that? Do u meanit shouldn't behave like that?
--------------
Nayan
18 years ago
CheckedException-> The exceptions which can be handled by the programmer. In some scenarios, programmer can anticipate the type of exceptions that can be thrown from the application. As for example, whenever we do file operation, we know that it might throw FileNotFoundException if it can't locate the particular file.
UncheckedException-> The exceptions which can't be handled by the programmer, those are Unchecked exceptions. All unchecked exceptions are subclass of RuntimeException. These exceptions are ususally hadled by JVM. Programmer don't have control over these exceptions, so JVM takes care of that.
--------------
Nayan.
18 years ago
String class and all the Wrapper classes override the equals method by default to check the contents of two objects. For other classes, u have to override equals() method explicitly.
-------------
Nayan.
Nice example, Arun
I forgot to mention example!!
18 years ago
In some applications, output is redirected to a file. In that scenario, System.err.println() is used to display the error messages in the console. If we use System.out.println(), then all the messages will be redirected to the specified file. This is done in order to prevent the error messages being displayed in the redirected file.
------------
Nayan.
18 years ago
I mean, put the whole file in a String object. Now, u can search for the keyword using the indexOf() method of String class. That will give u the position of the keyword(u are looking for). Now, get the data whole data using the location and append that in u'r file. For that, u can use of substring(int,int) method.
Does this help u?
-----------
Nayan
18 years ago
Hi,
Do u use package in u'r Java program? If u use package, then u have to set that in u'r CLASSPATH, or else set the CLASSPATH=.;
----------
Nayan
18 years ago
Interface is primarily the replacement of Multiple inheritance in Java.
-------------
Nayan
18 years ago
One more solution....
U can use the class called Timestamp which extends Date class. Date class has methods of comparing two objects.
Hope, this helps u.
------------
Nayan
18 years ago
Hi Angela,
I think, u can use String class methods to seek for specific words location. RandomAccessFile won't be helpful for that matter.
--------------
Nayan
18 years ago