By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,932 Members | 1,468 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,932 IT Pros & Developers. It's quick & easy.

Java to VB.Net question

P: n/a
Hi, could someone help me along with a Java to VB.Net conversion.
Here is the java code

private sub test1() throws Exception
{
//code in here
}

private sub test2()
{
//code in here
}

And here is my conversion for subroutine test2 - but what is the
VB.Net equivalent for test1 ?
Private Sub test2()
'code in here
End Sub

Thanks
Michael
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
If I understand correctly you are trying to catch an exception.

For this in VB.Net you can use a try catch block

Private Sub Test1()
Try
'code in here
Catch exc as exception
'code in here to act on exc
End Try
End Sub
"Michael Murphy" <mi***********@hotmail.com> wrote in message
news:6c**************************@posting.google.c om...
Hi, could someone help me along with a Java to VB.Net conversion.
Here is the java code

private sub test1() throws Exception
{
//code in here
}

private sub test2()
{
//code in here
}

And here is my conversion for subroutine test2 - but what is the
VB.Net equivalent for test1 ?
Private Sub test2()
'code in here
End Sub

Thanks
Michael

Nov 20 '05 #2

P: n/a
You have mixed your Java and VB.Net already, a slippery slope indeed! Your
original Java should have read:

private void test1() throws Exception
{
//code in here
}

private void test2()
{
//code in here
}
Now in answer to your original question about conversion - ** there are no
checked exceptions in VB.Net **. The "conversion" of both test1 and test2 is
shown below.
Private Sub test2()
'code in here
End Sub

Private Sub test1()
'code in here
End Sub
The JLCA available from Microsofts web site (albeit J to C#) and other
on-line resources will be about to point you in the right direction for
further conversions.

Hexathioorthooxalate

"Michael Murphy" <mi***********@hotmail.com> wrote in message
news:6c**************************@posting.google.c om...
Hi, could someone help me along with a Java to VB.Net conversion.
Here is the java code

private sub test1() throws Exception
{
//code in here
}

private sub test2()
{
//code in here
}

And here is my conversion for subroutine test2 - but what is the
VB.Net equivalent for test1 ?
Private Sub test2()
'code in here
End Sub

Thanks
Michael


Nov 20 '05 #3

P: n/a
* mi***********@hotmail.com (Michael Murphy) scripsit:
Hi, could someone help me along with a Java to VB.Net conversion.

Here is the java code

private sub test1() throws Exception
{
//code in here
}

private sub test2()
{
//code in here
}
And here is my conversion for subroutine test2 - but what is the
VB.Net equivalent for test1 ?


There are no "checked exceptions" in VB.NET.

<http://radio.weblogs.com/0122027/stories/2003/04/01/JavasCheckedExceptionsWereAMistake.html>

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ue**************@TK2MSFTNGP12.phx.gbl...

There are no "checked exceptions" in VB.NET.

<http://radio.weblogs.com/0122027/sto...kedExceptionsW
ereAMistake.html>
--


Exactly what I said when I replied to the group earlier. And thinking about
it a bit more, we both should have said:

There are no "checked exceptions" in .Net

Nov 20 '05 #5

P: n/a
* "hexathioorthooxalate" <ru***@REMOVESPAM.clara.co.uk> scripsit:
There are no "checked exceptions" in VB.NET.

<http://radio.weblogs.com/0122027/sto...kedExceptionsW
ereAMistake.html>

Exactly what I said when I replied to the group earlier. And thinking about
it a bit more, we both should have said:

There are no "checked exceptions" in .Net


No problem. I feel sorry, but because of my slow internet connection, I
didn't see your post (it wasn't downloaded yet).

;-)

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.