先學j2se,建議你先看視頻,上網搜馬士兵的視頻,講得很好,有點c語言基礎都能看懂,看完視頻再去找本書把所有類容看一遍,等j2se基礎好了,學j2ee就比較好學了,網上教學視頻很多,學起來還是挺方便的
② java基礎編程題
沒看懂,啥玩意寫的。不用這樣寫。
你首先寫個東西 要理解清思路。
1、輸入字元串
2、輸入需要查詢的字元串
3、從字元串中找到需要查詢字元串的開始位置
4、如果值為-1則結束,有值的話則用找到的開始位置+需要查詢字元串的長度 ,
這個長度就是需要查詢字元串在原字元串中的結束位置。
還有類名 開頭大寫不要用什麼中文,還有變數名稱起好一點別這么隨便,
③ Java初級編程
//測試已通過,望採納
//第三題
importjava.io.BufferedReader;
importjava.io.IOException;
importjava.io.InputStreamReader;
publicclassmonths{
publicstaticvoidmain(String[]args)throwsIOException{
String[]months={"January","February","March","Apri","May"
,"June","July","August","September","October",
"November","December"};
System.out.print(" Inputyourmonths:");
BufferedReaderbuf=newBufferedReader(newInputStreamReader(System.in));
Stringstr=buf.readLine();
intm=Integer.parseInt(str);
System.out.print(" Thisis"+m+"English:"+months[m-1]);
}
}
//第四題
classTeacher{
privateintnum;
privateStringname;
privateintage;
privateStringdegree;
privateintworkyear;
publicTeacher(){
}
publicTeacher(intnum,Stringname,intage,Stringdegree,intworkyear){
this.num=num;
this.name=name;
this.age=age;
this.degree=degree;
this.workyear=workyear;
}
publicvoidouput(){
System.out.print(" ThisisNum:"+num+"Name:"+name+" Age:"+age+"Degree:"+degree
+"WorkYear:"+workyear);
}
publicintgetNum(){
returnnum;
}
publicvoidsetNum(intnum){
this.num=num;
}
publicStringgetName(){
returnname;
}
publicvoidsetName(Stringname){
this.name=name;
}
publicintgetAge(){
returnage;
}
publicvoidsetAge(intage){
this.age=age;
}
publicStringgetDegree(){
returndegree;
}
publicvoidsetDegree(Stringdegree){
this.degree=degree;
}
publicintgetWorkyear(){
returnworkyear;
}
publicvoidsetWorkyear(intworkyear){
this.workyear=workyear;
}
}
publicclassdemo{
publicstaticvoidmain(String[]args){
Teachert=newTeacher(1,"season",30,"BlueShit",8);
t.ouput();
}
}
④ JAVA基礎編程題
package com.qiu.swing.layoutDemo;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JRootPane;
import javax.swing.JTextField;
/**
*
* @author Qiu
*
*/
public class TextDemo extends JFrame{
final JButton button_show = new JButton("顯示");
final JButton button_clear = new JButton("顯示");
final JTextField text = new JTextField();
final Container con = this.getContentPane();
public TextDemo() {
this.setTitle("HelloWorld!");
this.setSize(300, 160);
// 居中
this.setLocationRelativeTo(null);
this.setUndecorated(true); // 去掉窗口的裝飾
this.setResizable(false);
this.getRootPane().setWindowDecorationStyle(
JRootPane.INFORMATION_DIALOG);// 採用指定的窗口裝飾風格
// 文字居中
text.setSize(100, 20);
Box vbox = Box.createVerticalBox();
Box xbox0 = Box.createHorizontalBox();
xbox0.add(text);
xbox0.add(button_show);
xbox0.add(button_clear);
vbox.add(xbox0);
vbox.add(Box.createVerticalStrut(100));
con.setLayout(new BoxLayout(con, BoxLayout.X_AXIS));
con.add(vbox);
button_show.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
text.setText("HelloWorld");
}
});
button_clear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
text.setText("");
}
});
}
public static void main(String[] args) {
TextDemo home = new TextDemo();
home.setVisible(true);
}
}
⑤ java編程基礎
就是一個數字。文件里本來都是二進制,你readInt,就給你轉換成了一個Int
⑥ 學JAVA基礎編程.J2EE
C語言你學不學都可以,學有學的好處和懷處.
首先好處是:
學了C語言對於控制流語法熟悉了,能為JAVA打下基礎.
C語言的結構有助於JAVA類的過度理解
但是C語言的某些編程習慣在JAVA中非常不實用
容易產生混亂.
我建議先不要學習C語言
但是,我是先學的C語言
提一點學習JAVA的建議吧
首先你要知道"hello world"在JAVA中怎麼運行
因為"hello world"能告訴你JAVA程序是怎麼運行的.
然後粗略的理解面向對象的思想.
通過API了解JAVA中的lang,util,io這三個包
接下來就可以看gui界面設計了,也就是javax.swing包和
java.awt包.
試著使用java.sql包與資料庫連接.
最重要的一點,時刻要有把自己解脫的思想,盡可能的做到代碼重用.試著自己設計類庫.
多看點SUN公司的核心技術叢書.
最後補充一句話,寫程序為客戶著想.
⑦ Java基礎編程
import java.util.Scanner;
public class TestJava {
public static void main(String[] args){
System.out.print("Enter a Binary string: ");
Scanner sc = new Scanner(System.in);
String input = sc.nextLine();
//判斷輸入的格式
if(input.matches("[0|1]+")){
//輸出二進制到十進制的轉換
System.out.println(Long.parseLong(input,2));
}else{
System.out.println("Invalid Binary String "+input);
}
sc.close();
}
}
⑧ JAVA初級編程需要學習多長時間
Java自學想學到可以工作的程度大概需要1年的時間,培訓班的話大概需5、6個月。J ava初級編程需要學習多長時間,更多的還是跟你的學習態度、課後的一個回顧總結、理論與實踐相結合的能力等相掛鉤。因此,Java初級編程需要學習多長時間,只能說因人而異,要注重將理知識應用於實戰中。在學習過程中,嘗試思考項目做下來的整個流程。多總結,多去動手實際操作,而不是一味的依賴於理論知識的識記。
⑨ JAVA 最基礎的編程 main函數的編寫
這個不行,問題處在getClass()上,java每個類都已經有返回值為Class<?>,方法名為getClass的方法,繼承自Object,按照你的題意是要返回值為String,方法名為getClass的方法,那肯定就不行了。並且你班級的屬性也不能叫class,那是關鍵字。
你若是getClass改個名的話能寫,否則別想
⑩ Java是基礎的編程語言嘛
算基礎之一,可以說現在大部分商業系統都是JAVA開發出來的。說JAVA基礎是因為他語法里保留了很多對內存的直接操作,比如int這類直接對應4個位元組,有些高級語言整數是一個對象。現在最基礎的還是c語言。