Title: Visual%20Basic%20vs%20JAVA
1Visual Basic vs JAVA
- Namon Nuttayasakul
- Myat Min
2Introduction
- Visual Basic is a software development system
developed by Microsoft to support creating
programs for the Windows operating systems
3History of Visual Basic
- VB version 1 a custom-control edition
- VB version 2 introduced the OOPS
- VB version 3,4 business orientation
- VB version 5 is a big breakthrough of OOPS
- VB version 6 the network version of VB.
4VB as an OOPS
- OOPS (Object Oriented Programming Systems)
- Microsofts object Basic
- Visual Basic for Application (VBA)
5Object
- A data type with intelligence.
- An example of object is
- Spread Sheet
6Creating an object in VB
- General process to create object variable
- Create an object variable (Dim).
- Allocate an object in memory with New or
CreateObject , and then assign it to the object
variable.
7Creating an object in VB
ObjectVariable
?
Create an object variable
Dim ObjName As Object
8Creating an object
Object of type myClass
ObjVariable
Allocate an object in memory with New
Set ObjVariable New myClass
9 Three ways to create an object
- Use Dim and New together
- Dim objectName As New className
- Using New
- Public objectName As New ClassName
- Using CreateObject
- Set fso CreateObject(Scripting.FileSystemObjec
t)
10Object type
11Defining a New Class
- JAVA uses block of keyword class statement
- VB uses Class Module
12Class module
Declare property Property Get read
only Property Let write-only Both
read-write Private m_Sam As Long Public
Property Get SamAccount() As Long Sam
m_Sam End Property Public Property Let
SamAccount(ByVal newVal As Long) m_Sam
newVal End Property
- Class module for Stack
- Stack object
Properties
Methods
?
Read-only
Count
Push
sub
Read-write
function
Item
Pop
133 OOPS major features
- Encapsulation
- Inheritance
- Polymophysm
14Encapsulation
Methods
Properties
?
Push
Count
Pop
Item
Hiding implementation
15Inheritance
Push
new code
Pop
Count
Object of existing class
Item
New Object
16Polymorphism
- ListBox.Property Let Visible
- CompBox.Property Let Visible
- Picture.Property Let Visible
Ctrl 1
Ctrl 2
Ctrl 3
Early Binding
Substiture any class Property Let Visible Is
search for at run time, In the list of
procedures Supported by item
Property Let Visible
item
Late Binding
17Conclusion
FUNCTIONS VB JAVA
Complete object-oriented No Yes
Cross-platform compatible No Yes
Distributed Yes Yes
Ease to use Easier Harder
Secure Poorer better