Comment on Tutorial - Simple Port Scanner application using Java By Syed M Hussain
Comment Added by : mobinga
Comment Added at : 2011-07-25 15:08:27
Comment on Tutorial : Simple Port Scanner application using Java By Syed M Hussain
Your code is syntactically correct, but semantically wrong.
You have to put the output statement within the catch blocks!
for(int i=startPortRange; i <=stopPortRange; i++)
{
try
{
Socket ServerSok = new Socket("127.0.0.1",i);
System.out.println("Port in use: " + i );
ServerSok.close();
}
catch (Exception e)
{ System.out.println( "Port" + i + "Not in Use");}
}
View Tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Subscribe to Tutorials
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Archived Comments
1. Is operator overloading possible in java??????
View Tutorial By: rishi at 2008-11-01 23:55:55
2. Well explained. Example clear out the diff
View Tutorial By: sonam at 2014-06-25 19:05:20
3. I want to download that 5 sms sending program .fro
View Tutorial By: anwar at 2008-09-08 02:22:06
4. I executed your code but i get the error "OK
View Tutorial By: Denzil at 2013-01-18 09:33:37
5. thanks
View Tutorial By: snooker at 2013-02-04 19:45:40
6. I writing a main class in the eclipse IDE and call
View Tutorial By: adam lim at 2013-03-11 04:13:51
7. Plse Send me The Code For Sms Application to My Ma
View Tutorial By: Santoshb at 2010-09-08 07:08:55
8. Good examples. However... I am testing for a Hex v
View Tutorial By: Doug Whitehead at 2008-11-29 17:10:43
9. hi,
i have tried to download the sun api fr
View Tutorial By: raghu at 2009-01-07 05:45:33
10. Thks a lot..... The way of giving explanation and
View Tutorial By: Hari at 2011-04-08 02:58:06