java程序设计
A. java程序设计
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test {
public static void main(String[] args) {
BufferedOutputStream out = null;
try {
out = new BufferedOutputStream(new FileOutputStream(new File("d:/info.txt")));
String line = "第一行文本\n第二行文本";
out.write(line.getBytes());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
BufferedInputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream("d:/info.txt"));
StringBuffer buffer = new StringBuffer();
byte[] buff = new byte[in.available()];
while (in.read(buff) != -1) {
buffer.append(new String(buff));
}
System.out.println(buffer);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
in = null;
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
B. JAVA程序设计
public class Student {
    private String id;
    private String name;
    private double store;
    public Student(String id, String name, double store) {
        this.SetRecord(id, name, store);
    }
    public void SetRecord(String id, String name, double store) {
        this.id = id;
        this.name = name;
        this.store = store;
    }
    public String GetRecord() {
        return "id=" + id + ",name=" + name + ",store=" + store;
    }
    public static void main(String[] args) {
        Student stuA = new Student("na001", "jack", 98.5);
        System.out.println("该学生的信息为:\n" + stuA.GetRecord());
    }
}
C. Java程序设计语言是什么意思
Java是由SunMicrosystems公司于1995年推出的一门面向对象程序设计语言。2010年Oracle公司收购SunMicrosystems,之后由Oracle公司负责Java的维护和版本升级。
其实,Java还是一个平台。Java平台由Java虚拟机(JavaVirtualMachine,JVM)和Java应用编程接口(,API)构成。
Java应用编程接口为此提供了一个独立于操作系统的标准接口,可分为基本部分和扩展部分。在硬件或操作系统平台上安装一个Java平台之后,Java应用程序就可运行。
Java平台已经嵌入了几乎所有的操作系统。这样Java程序只编译一次,就可以在各种系统中运行。Java应用编程接口已经从1.1x版本发展到1.2版本。常用的Java平台基于Java1.6,最新版本为Java1.8。
Java发展至今,就力图使之无所不能。按应用范围,Java可分为3个体系,即JavaSE、JavaEE和JavaME。

(3)java程序设计扩展阅读
Java语言的特点
Java语言的风格很像C语言和C++语言,是一种纯粹的面向对象语言,它继承了C++语言面向对象的技术核心,但是抛弃了C++的一些缺点,比如说容易引起错误的指针以及多继承等,同时也增加了垃圾回收机制,释放掉不被使用的内存空间,解决了管理内存空间的烦恼。
1、面向对象
Java是一种面向对象的语言,它对对象中的类、对象、继承、封装、多态、接口、包等均有很好的支持。为了简单起见,Java只支持类之间的单继承,但是可以使用接口来实现多继承。使用Java语言开发程序,需要采用面向对象的思想设计程序和编写代码。
2、平台无关性
平台无关性的具体表现在于,Java是“一次编写,到处运行(WriteOnce,RunanyWhere)”的语言,因此采用Java语言编写的程序具有很好的可移植性,而保证这一点的正是Java的虚拟机机制。在引入虚拟机之后,Java语言在不同的平台上运行不需要重新编译。
Java语言使用Java虚拟机机制屏蔽了具体平台的相关信息,使得Java语言编译的程序只需生成虚拟机上的目标代码,就可以在多种平台上不加修改地运行。
3、简单性
Java语言的语法与C语言和C++语言很相近,使得很多程序员学起来很容易。对Java来说,它舍弃了很多C++中难以理解的特性,如操作符的重载和多继承等,而且Java语言不使用指针,加入了垃圾回收机制,解决了程序员需要管理内存的问题,使编程变得更加简单。
4、解释执行
Java程序在Java平台运行时会被编译成字节码文件,然后可以在有Java环境的操作系统上运行。在运行文件时,Java的解释器对这些字节码进行解释执行,执行过程中需要加入的类在连接阶段被载入到运行环境中。
5、多线程
Java语言是多线程的,这也是Java语言的一大特性,它必须由Thread类和它的子类来创建。Java支持多个线程同时执行,并提供多线程之间的同步机制。任何一个线程都有自己的run()方法,要执行的方法就写在run()方法体内。
D. JAVA程序设计主要讲的是什么
Java高级框架等知识,主要包含:前端技术、数据库 、JAVA数据库操作、软件服务器及服务器相关技术 、动态网页JSP、AJAX、SpringMVC、MyBatis、Spring、MySQL高级、Linux&Redis&Nginx、Maven等知识点。
E. Java程序设计
我给你找的,你修修改改就应该差不多了
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class NewTxt {
 public static void main(String[] args) throws IOException {
int n = 5;  //N*N数组
double[][] arr = new double[n][n]; //插入的数组
double[][] arr2 = new double[n][n];;  //读取出的数组
//数组初始化,随机生成的[0,100)之间的double数
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
arr[i][j] = Math.random()*100;
System.out.println(arr[i][j]);
}
}
File file = new File("d:\\array.txt");  //存放数组数据的文件
FileWriter out = new FileWriter(file);  //文件写入流
//将数组中的数据写入到文件中。每行各数据之间TAB间隔
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
out.write(arr[i][j]+"\t");
}
out.write("\r\n");
}
out.close();
BufferedReader in = new BufferedReader(new FileReader(file));  //
String line;  //一行数据
int row=0;
//逐行读取,并将每个数组放入到数组中
while((line = in.readLine()) != null){
String[] temp = line.split("\t");
for(int j=0;j<temp.length;j++){
arr2[row][j] = Double.parseDouble(temp[j]);
}
row++;
}
in.close();
//显示读取出的数组
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print(arr2[i][j]+"\t");
}
System.out.println();
}
}
}
F. java程序设计
import javax.swing.*;
public class Test extends JFrame{
	JLabel label1,label2,label3;
	JTextField username,pass;
	JButton b;
	JComboBox cb;
	Object[] data=new Object[]{"263.net","qq.com"};
	
	public Test() {
		label1=new JLabel("邮箱");
		label2 = new JLabel("@");
		label3 = new JLabel("密码");
		username=new JTextField(10);
		pass = new JPasswordField(10);
		cb=new JComboBox(data);
		b=new JButton("登陆");
		
		JPanel p=new JPanel();
		this.getContentPane().add(p);
		p.add(label1);
		p.add(username);
		p.add(label2);
		p.add(cb);
		p.add(label3);
		p.add(pass);
		p.add(b);
		
		this.setVisible(true);
		this.setBounds(100,100,500,150);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	public static void main(String[] args) {
		new Test();
	}
}
G. java程序设计
下面是BankAccount类的代码:
public class BankAccount {
private String name;
private double balance;
private int year;
private double rate = 0.01d;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getRate() {
return rate;
}
public void setRate(double rate) {
this.rate = rate;
}
public double getBalance() {
return balance;
}
public BankAccount() {
this.balance = 10d;
this.year = 1;
}
public BankAccount(double balance, int year) {
this.balance = balance;
this.year = year;
}
public void save(double balance, int year) {
this.balance = this.balance + balance;
this.year = year;
}
public void fetch(double balance) {
this.balance = this.balance - balance;
this.year = 0;
}
public double calcTotal() {
return this.balance * this.rate * this.year + this.balance;
}
}
下面是BankTest类的代码:
public class BankTest {
public static void main(String[] args) {
BankAccount account = new BankAccount(1000d, 3);
account.setName("Tom");
account.save(2000d, 3);
System.out.println("该账户的姓名:" + account.getName());
System.out.println("该账户的存款额:" + account.getBalance());
System.out.println("该账户的总金额:" + account.calcTotal());
}
}
下面是运行结果:

麻烦您看一下,是否能够满足要求。
H. Java程序设计!
class Preson
{
    String name;
    String address;
    String phone;
    String email;
}
class Student extends Person
{
    public final  int CLASS_OF_ONE = 1;
    public final  int CLASS_OF_TWO = 2;
    public final  int CLASS_OF_THREE = 3;
    public final  int CLASS_OF_FOUR = 4;
}
class Employee extends Person
{
    String officeName;
    float money;
    Date date;//请自己使用format完成格式化
} /** *自己完成标准的get set方法,后面的class写法如上继承就行了 */
I. Java程序设计
你怎么不找我呢?这个问题叫约瑟夫环,对我来说再简单不过了,
你给的QQ有问题,加不了:
http://..com/question/160993747.html
我的是807704186。
下面我写的注释:
public class Joseph{
   
 public static int[] b = new int[100]; //出圈顺序存储装置
 
/**约瑟夫*/
 
    public static void joseph(int sum,int n,int arr[]){
     /**sum:总数; n:间隔数; arr:初始顺序  */
     int i = 0;
  int all = sum;           //开始时arr[]中还剩的元素个数
  int times = 0;           //间隔数
     while(all>0){         //所剩元素不为0,继续数
        if(arr[i]!=0){     //数到有效元素(非0有效,0无效),间隔数加1
        times++;    
        if(times==n){   //间隔数达到指定数目,出圈
           b[sum-all]=arr[i]; //出圈步骤①:当前位置序号扔给出圈顺序存储装置的指定位置
        arr[i] = 0;        //出圈步骤②:当前有效位变为无效位
        times = 0;         //出圈步骤③:间隔数指示器变0,重新开始数
     all--;             //出圈步骤④:剩余数量减1
       }
                 i = (i+1)%sum;  //指示器后移一位,运用整除运算符,到头的会自动转到开始     
       }
   else  
     i = (i+1)%sum;  //数到的是无效元素,指示器直接后移一位   
     } 
     /**
      * 值得注意的是:出圈顺序得到的元素表示的是初始的位置
      * 所以:只要在后面15个元素所表示的位置上,指定相应颜色就可以了。
      * */
     System.out.print("\n出圈顺序:");
     for(int k=0;k<sum;k++)
     System.out.print(b[k]+",");
     
 } 
      
   public static void main(String args[]){
       int sum = 30;
    int n = 13;
    int[] a = new int[sum];   
      for(int i=0;i<sum;i++){
    a[i] = i+1;
   }     //初始化初始队列顺序:1、2、3、4、5......30
      System.out.print("\n初始顺序:");  
      for(int k=0;k<sum;k++)
       System.out.print(a[k]+",");       
    joseph(sum,n,a);  
   }
}
得到的打印结果是:
初始顺序:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
出圈顺序:13,26,9,23,7,22,8,25,12,30,18,6,29,20,15,10,4,3,5,14,19,28,17,11,16,27,1,2,21,24,
所以只要在:“10,4,3,5,14,19,28,17,11,16,27,1,2,21,24,”这些位置上指定为绿球就可以了。
