當前位置:首頁 » 操作系統 » j2se源碼

j2se源碼

發布時間: 2022-03-13 00:16:51

java如何引用JAVA源碼

別人JAVA的源碼--你如果已經拿到手,可以打成jar包,如果只是為了演示,那隨便添加到項目的構建路徑或類路徑。然後你就可以在你創建的Java文件中引用jar包中已寫好的類,進而完成你的功能。

Ⅱ java源代碼如何用

java源代碼是txt格式的.java文件,用記事本就可以打開。
用eclipse打開java文件的方式是:
如果java文件是一個eclipse工程(根目錄帶有.project文件),用file/import/general/exist java project/(大概是)然後找到你的目錄。
否則需要自己新建一個工程file/new/java project
然後把java文件拷貝到.src目錄下。
.class文件是直接的編譯好的文件,可以用jad把.class文件反編譯成java文件,不過反編譯的代碼和原來的代碼不一定完全一樣。

Ⅲ 什麼是java源代碼 怎麼查看

不知道你說的是瀏覽器的還是什麼的,
如果是瀏覽器的那麼簡單找到工具-查看源代碼,你就能看見代碼了,
還有一個就是被編譯成class文件的java用反編譯工具可以看到源代碼,
如果以上都不是你想要的答案,那麼你所說的代碼就是程序員寫好的代碼文件

Ⅳ java源代碼

這個關鍵是在於 心理測試本身的測試方法吧,java只是一個工具,怎麼能提供這個呢?
還是我語文沒有念好,沒有明白lz的意思。

Ⅳ java se的源代碼怎麼用

你有沒有裝java虛擬機或者是java的開發環境。
有開發環境的話,把.java文件復制進去,直接運行就可以了,.class也會在那個時候 幫你編譯好,你下載來的那個基本用不到了。
如果是用虛擬機,要先下載安裝一個jdk,然後設定環境變數,然後在dos環境下使用java命令來運行,這個麻煩,不推薦。

Ⅵ Java源代碼

packagecom.;

importjava.util.ArrayList;
importjava.util.List;
importjava.util.Scanner;

importstaticjava.lang.System.out;
importstaticjava.lang.System.in;
/**
*Createdbytracyon2017/10/11.
*/
publicclassLR{

staticint[]numbers;
staticList<Domain>domains=newArrayList<>();

publicstaticvoidmain(String...asd){
intm,n;
out.print("請輸入數字個數N:");
n=input(1,Integer.MAX_VALUE);
out.print("請輸入計算行數M:");
m=input(1,10000);
out.println("請輸入"+n+"個數字,每個數字介於1跟1000000之間,用空格隔開:");
numbers=inputNumbers(n);
for(inti=0;i<m;i++){
domains.add(inputDomain(n,i+1));
}
for(Domaindomain:domains){
domain.output();
}
}

/**
*輸入一個介於min跟max之間的整數
*@parammin
*@parammax
*@return
*/
privatestaticintinput(intmin,intmax){
Scannerscanner=newScanner(in);
try{
inti=scanner.nextInt();
if(i<min||i>max){
out.print("輸入數字大小不符合要求,請重新輸入」");
returninput(min,max);
}
returni;
}catch(Exceptione){
out.print("您輸入的不是數字,請重新輸入「");
returninput(min,max);
}
}

/**
*輸入N個介於1到1000000之間的整數
*@paramn
*@return
*/
privatestaticint[]inputNumbers(intn){
Scannerscanner=newScanner(in);
StringnumStr=scanner.nextLine();
String[]nums=numStr.trim().split("\s+");
if(nums.length!=n){
out.println("輸入數字個數不對,請重新輸入:");
returninputNumbers(n);
}
int[]numbers=newint[n];
for(inti=0;i<n;i++){
try{
intnumber=Integer.valueOf(nums[i]);
if(number<1||number>10000){
out.print("輸入數字大小不符合要求,請重新輸入」");
numbers[i]=input(1,1000000);
}else{
numbers[i]=number;
}
}catch(NumberFormatExceptione){
out.print(String.format("您輸入的%s不是數字,請重新輸入:",nums[i]));
numbers[i]=input(1,1000000);
}
}
returnnumbers;
}

(intn,intindex){
out.println("請輸入第"+index+"行的2個數字L,R(1<=L<=R<=%d)用空格隔開:");
Scannerscanner=newScanner(in);
StringnumStr=scanner.nextLine();
String[]nums=numStr.trim().split("\s+");
if(nums.length!=2){
out.print(String.format("輸入數字個數不對,請重新輸入!",n));
returninputDomain(n,index);
}
Stringls=nums[0];
Stringrs=nums[1];
try{
intl=Integer.valueOf(ls);
intr=Integer.valueOf(rs);
if(l<1||r<l||r>n){
out.print(String.format("輸入數字大小不符合,請重新輸入!",n));
returninputDomain(n,index);
}
returnnewDomain(l,r,index);
}catch(NumberFormatExceptione){
out.println(String.format("輸入數字格式錯誤,請重新輸入2個數字L,R(1<=L<=R<=%d)用空格隔開:",n));
returninputDomain(n,index);
}
}

privatestaticclassDomain{
intl;
intr;
intindex;

Domain(intl,intr,intindex){
this.l=l;
this.r=r;
this.index=index;
}

voidoutput(){
intresult=0;
for(inti=l-1;i<r;i++){
result+=numbers[i];
}
out.println(String.format("第%d行:第%d到第%d個數之和為:%d",index,l,r,result));
}
}
}

Ⅶ 初學者請求java源代碼

//調試過的,肯定好使

class car {
// 品牌
private String brand;
// 發動機排量
private double engineDisplacement;
// 速度
private double speed=0;
// 狀態
private boolean status=false;
// 最高時速
private double maxSpeed;
// 構造函數
car(String brand, double engineDisplacement, double maxSpeed) {
this.brand = brand;
this.engineDisplacement = engineDisplacement;
this.maxSpeed = maxSpeed;
}
// 啟動
void start(){
this.status=true;
System.out.println(this.status);
System.out.println(this.speed);
}
// 加速
double speedUp(){
this.speed+=20;
this.speed=this.speed>=this.maxSpeed?this.maxSpeed:this.speed;
this.status=this.speed>0?true:false;
System.out.println(this.status);
System.out.println(this.speed);
return this.speed;
}
// 減速
double slowDown(){
this.speed-=10;
this.speed=this.speed>=0?this.speed:0;
this.status=this.speed==0?false:true;
System.out.println(this.status);
System.out.println(this.speed);
return speed;
}
// 熄火
void stop(){
this.status=false;
this.speed=0;
System.out.println(this.status);
System.out.println(this.speed);
}
}
//TestCar類,輸出應該是一堆列印信息
public class TestCar{

public static void main(String args[]){
car iCar=new car("紅旗",2.0,120.00);
iCar.start();
//加速7次,實際上最後一次應該是加速不了的
for(int i=0;i<7;i++){
iCar.speedUp();
}
//減速13次,實際上最後一次應該是減不了的
for(int j=0;j<13;j++){
iCar.slowDown();
}
iCar.stop();
}
}

Ⅷ 在哪能找到java源代碼

引用:down.china-code.net
引用:down.chinaz.com
引用:www.koders.com
引用:www.javaalmanac.com
引用:www.sourceforge.org
引用:www.apache.org
引用:www.theserverside.com
引用:www.ebaole.com/sourcedown.html
引用:www.javacn.com

熱點內容
蘋果手機怎麼裝安卓耳機 發布:2024-09-25 03:23:48 瀏覽:741
linuxgcc64位 發布:2024-09-25 03:14:19 瀏覽:742
文件夾恢復軟體免費版 發布:2024-09-25 03:14:14 瀏覽:713
雅閣空調壓縮機多少錢 發布:2024-09-25 03:13:38 瀏覽:22
手機在哪裡找到解鎖密碼 發布:2024-09-25 03:09:21 瀏覽:995
宏被默認腳本 發布:2024-09-25 03:04:27 瀏覽:705
交叉編譯x264 發布:2024-09-25 02:58:59 瀏覽:437
安卓手機cpu關閉後怎麼打開 發布:2024-09-25 02:47:56 瀏覽:33
什麼配置的電子垃圾最好 發布:2024-09-25 02:41:57 瀏覽:526
如何租用雲伺服器挖fil 發布:2024-09-25 02:21:19 瀏覽:614