I want ask about Vector if there is a code to sort a list of vector that contain name ,Id and phone number .
Pleas,answer me
شكرا
تم الارسال 13/11/2008 - 01:05 PM
تم الارسال 13/11/2008 - 02:34 PM
تم الارسال 16/11/2008 - 12:47 PM
package controller;
import java.util.ArrayList;
import java.util.List;
import model.Employee;
import model.Faculty;
import model.Staff;
public Class EmployeesBean {
private List<Employee> employeesList=new ArrayList<Employee>();
public List<Employee> getEmployeesList(){
employeesList.add(new Faculty("Sayed", 5000, "Lecturer","Engineering"));
employeesList.add(new Faculty("Rawan", 7000, "Prof.","Law"));
employeesList.add(new Faculty("Razan", 9000, "TA","Science"));
employeesList.add(new Staff("Hassan", 5000, "Clerk","Admin"));
employeesList.add(new Staff("Saeed", 5000, "HelpDesk","Library"));
employeesList.add(new Staff("Tarik", 5000, "Manager","HR"));
return employeesList;
}
}public Faculty(String name,double salary,String college, String rank) {
super();
setSalary(salary);
setName(name);
this.college = college;
this.rank = rank;
}
public Faculty() {
super();
setSalary(0.0);
setName(null);
this.college = null;
this.rank = null;
}
تم الارسال 16/11/2008 - 01:00 PM
تم الارسال 17/11/2008 - 02:27 AM
إقتباس
إقتباس
تم الارسال 20/11/2008 - 09:45 PM
تم الارسال 21/11/2008 - 03:23 AM
تم الارسال 21/11/2008 - 02:00 PM
تم الارسال 22/11/2008 - 03:09 PM
import java.util.*;
public class Q3
{
static Scanner input = new Scanner (System.in);
public static void main ( String args [] )
{
String str;
char x;
int y;
// a
System.out.println("Enter char");
x = input.next().charAt(0);
y = (int)(x);
System.out.println(y);
// b
int num1 , num2;
System.out.println("Enter string");
str = input.next();
num1 = str.indexOf(x);
num2 = str.indexOf(x,num1+1);
System.out.println("the indexes are "+ num1+" and " + num2 );
// c
System.out.println(str.replace(x,' '));
}
}
تم تعديل هذه المشاركة بواسطةاستثنائيه: 22/11/2008 - 03:17 PM
تم الارسال 25/11/2008 - 10:25 PM
تم الارسال 26/11/2008 - 06:25 AM
تم الارسال 26/11/2008 - 06:55 AM
public class Test {
public static void main(String[]args){
int result= calculate();
System.out.println("The result is:"+result);
}
private static int calculate() {
int x=1;
for(int i=0;i<=5;++i){
x+=i;
}
return x;
}
}
تم الارسال 26/11/2008 - 03:29 PM
تم الارسال 26/11/2008 - 07:07 PM
تم الارسال 26/11/2008 - 08:33 PM
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
public class Testthis extends JFrame implements ActionListener {
private JPanel panel; //crate object panel from class JButton
private JButton hello; // crate object hello from class JButton
// making a constructor
public Testthis(){
panel=new JPanel(); // reverse a place in memory for "panel" opject
hello=new JButton("Hello"); // reverse a place in memory for "hello" opject
hello.addActionListener(this);
panel.add(hello);
getContentPane().add(panel,BorderLayout.CENTER);
}
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null,"Hiiiii Bian, i hope to be funny with java");
}
public static void main(String[]args){
JFrame frame=new Testthis();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setVisible(true);
frame.setSize(new Dimension(500,250));
}
}
تم الارسال 26/11/2008 - 10:56 PM
تم الارسال 27/11/2008 - 05:28 AM
public void setRefNumber (String ref)
تم الارسال 27/11/2008 - 05:56 AM
إقتباس
إقتباس
|
|