-
Dta Base
Hi all,
I have modified this one to accept Transistors.
What I need is: having communication with the user.
i.e. window to enter a new itme, and another one to get the information from the program.
// TestToString.java
//
//
// Cut and paste this code into a file named:
// TestToString.java
//
// Compile and run:
// javac TestToString.java
// java TestToString
//
//
// From: Joe Grip's Interactive Guide to Java 2
/*
class Employee {
String name;
int employeeID;
float salary;
public String toString() {
return ("Employee: " + name + " " +
"ID: " + employeeID + " " +
"Salary: " + salary );
}
}
*/
class Transistor {
String transistor;
String polarity;
int currentIC;
String nte;
//float nte;
public String toString() {
return ("Transistor: " + transistor + " " +
"Ic: " + currentIC + "mA " +
"NTE: " + nte );
}
}
class TestToString {
public static void main(String[] args) {
/*
Employee bob = new Employee ();
bob.name = "Robert Zacks";
bob.employeeID = 2133;
bob.salary = 45000;
System.out.println(bob);
*/
Transistor trx = new Transistor ();
trx.transistor = "2SC945";
trx.polarity = "PNP";
trx.currentIC = 45000;
trx.nte = "123P";
System.out.println(trx);
}
}
-
try looking into the swing framework
Similar Threads
-
By Phil Weber in forum .NET
Replies: 632
Last Post: 10-01-2003, 12:00 AM
-
By Arthur Wood in forum .NET
Replies: 7
Last Post: 10-28-2002, 12:10 PM
-
Replies: 1
Last Post: 06-13-2002, 02:52 PM
-
By JIRAF in forum VB Classic
Replies: 0
Last Post: 04-01-2002, 12:33 PM
-
Replies: 1
Last Post: 03-23-2000, 03:05 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks