Amod Mulay

Ranch Hand
+ Follow
since Apr 06, 2006
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 Amod Mulay

I have read all you comments and would like to add some things or re-iterate it;
1. Interfaces declare(signeture) and not define(implement) the method.
2. you can implement multiple methods with same method signetures and it will not cause DDD.
3. and yes people do use such interfaces so that when they are type casting a object of a class implementing the interfaces they can type cast it to whichever type they want depending on the object use.

So there is nothing wrong in it. it is an added advantage
13 years ago
I have read all you comments and would like to add some things or re-iterate it;
1. Interfaces declare(signeture) and not define(implement) the method.
2. you can implement multiple methods with same method signetures and it will not cause DDD.
3. and yes people do use such interfaces so that when they are type casting a object of a class implementing the interfaces they can type cast it to whichever type they want depending on the object use.

So there is nothing wrong in it. it is an added advantage
13 years ago
Objects are always on the heap.
if you declare the string as Static as stated in the above post then it will go in the Stack.
Dont mistake String to be on stack always just because it is immutable. it will always be wrapped in an object
13 years ago
id does not compile as it does not know what is the type "Bark". unless you have a class by the name of Bark and have imported in your abstract class it will not compile.. please go through the book properly befor commenting that it does not work.
the compiler has to understand the return type!!!
13 years ago
id does not compile as it does not know what is the type "Bark". unless you have a class by the name of Bark and have imported in your abstract class it will not compile.. please go through the book properly befor commenting that it does not work.
the compiler has to understand the return type!!!
13 years ago
mystring = "firststring\secondstring some words"

First split it using array[] = mystring.split(" ");

then only that the first i.e names[] = array[0].split("\")
names[0] = "firststring"
names[1] = "secondstring"

a working example

public class StringSplit {
public static void main(String args[]) throws Exception{
new StringSplit().doit();
}

public void doit() {
// extra spaces
String s3 = "Real How To";
String [] temp = null;
temp = s3.split(" ");
dump(temp);
}

public void dump(String []s) {
System.out.println("------------");
for (int i = 0 ; i < s.length ; i++) {
System.out.println(s[i]);
}
System.out.println("------------");
}
}
/*
output :
------------
Real

How
To
------------
13 years ago
mystring = "firststring\secondstring some words"

First split it using array[] = mystring.split(" ");

then only that the first i.e names[] = array[0].split("\")
names[0] = "firststring"
names[1] = "secondstring"

a working example

public class StringSplit {
public static void main(String args[]) throws Exception{
new StringSplit().doit();
}

public void doit() {
// extra spaces
String s3 = "Real How To";
String [] temp = null;
temp = s3.split(" ");
dump(temp);
}

public void dump(String []s) {
System.out.println("------------");
for (int i = 0 ; i < s.length ; i++) {
System.out.println(s[i]);
}
System.out.println("------------");
}
}
/*
output :
------------
Real

How
To
------------
13 years ago
Make sure that the package that you have your class in has the same structure as in the name of the function in the dll
eg: com_siemens_fpag_fpverify_FAUVerification_FAUVerify() is the name of the function then the caller class would be in
com.siemens.fpag.fpverify.FAUVerification
13 years ago
Make sure that the package that you have your class in has the same structure as in the name of the function in the dll
eg: com_siemens_fpag_fpverify_FAUVerification_FAUVerify() is the name of the function then the caller class would be in
com.siemens.fpag.fpverify.FAUVerification
13 years ago
2 interfaces with the same name does not make any sence buddy.
interfaces do not have implementation of methods. and even if you do this thing "2 interfaces with same method name" still in the concrete class you wil lhave to have only one method. only advantage you will get out of this is that if you are creating an object of that class using reflection then you can easily type cast it in anywhich way you want
13 years ago
I dont exactly understand what you are trying to do here but from your heading let me give you some options:
1. you can creat an URL with different parameters onr flags dementding on your type of request in your href. and handle your flaga at the back end.
2. have multiple forms in your JSP of HTML and in the action define the action
I don't think you can force garbage collection.
you can do Runtime.getRuntime.gc()
or System.gc().
this will instruct the virtual machine to garbage collect but it is not necessary that JVM will do it immediately....

Cheers
Amod
14 years ago
oh yeah that worked thankx!
15 years ago
JSP
hi mandar
i have actually done that and implemented in my application but for some reason i am getting a n error
java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:179)
org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116)
org.apache.jsp.jsp.ManualAttendance.upload_jsp._jspService(upload_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


i dont know whats wrong...my code is like this

<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@ page import="org.apache.commons.fileupload.FileItem"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>
html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Process File Upload</title>
</head>
<%
System.out.println("Content Type ="+request.getContentType());

DiskFileUpload fu = new DiskFileUpload();
// If file size exceeds, a FileUploadException will be thrown
fu.setSizeMax(1000000);

List fileItems = fu.parseRequest(request);
Iterator itr = fileItems.iterator();

while(itr.hasNext()) {
FileItem fi = (FileItem)itr.next();

//Check if not form field so as to only handle the file inputs
//else condition handles the submit button input
if(!fi.isFormField()) {
System.out.println("\nNAME: "+fi.getName());
System.out.println("SIZE: "+fi.getSize());
//System.out.println(fi.getOutputStream().toString());
File fNew= new File(application.getRealPath("/"), fi.getName());

System.out.println(fNew.getAbsolutePath());
fi.write(fNew);
}
else {
System.out.println("Field ="+fi.getFieldName());
}
}
%>
<body>
Upload Successful!!
</body>
</html>

and html

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
<TITLE>File Upload Page</TITLE>
</HEAD>
<BODY>Upload Files
<FORM name="filesForm" action="upload.java"
method="post" enctype="multipart/form-data">
File 1:<input type="file" name="file1"/><br/>

<input type="submit" name="Submit" value="Upload Files"/>
</FORM>
</BODY>
</HTML>
15 years ago
JSP