楼主: ReneeBK
1227 9

JAVA Programming, 1/e [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4897份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49635 个
通用积分
55.6937
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2015-9-25 10:07:34 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

  • JAVA Programming, 1/e
  • By: K. Rajkumar

  • Publisher: Pearson India

  • Pub. Date: May 1, 2013

  • Web ISBN-13: 978-9-3-3251787-5

  • Pages in Print Edition: 696

  • Subscriber Rating: [0 Ratings]




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Programming Program gram Ming Java JAVA

本帖被以下文库推荐

沙发
ReneeBK 发表于 2015-9-25 10:08:27
  1. Example 1.4. Creating Constants

  2. public static final int MAX = 100;
  3. public static final boolean isModified = false;
复制代码

藤椅
ReneeBK 发表于 2015-9-25 10:09:35
  1. Example 1.6. Type Casting

  2. int x = 100;
  3. long y = x; // upcasting
  4. int z = (int)y; // downcasting
  5. 100 + “hello” becomes “100hello” // concatenation
复制代码

板凳
ReneeBK 发表于 2015-9-25 10:10:08
  1. Example 1.7. Boxing and Unboxing

  2. Integer i = 5; // auto-boxing
  3. int j = 0;
  4. j = new Integer(5); // unboxing
复制代码

报纸
ReneeBK 发表于 2015-9-25 10:11:38
  1. Listing 1.2. WelcomeMe Application

  2. // WelcomeMe.java


  3. public class WelcomeMe
  4. {
  5.   public static void main(String[] args)
  6.   {
  7.     System.out.println(“Hello” + args[0]);
  8.   }
  9. }
复制代码

地板
ReneeBK 发表于 2015-9-25 10:12:10
  1. Listing 1.3. SumIt Application



  2. // Sumlt.java
  3. import java.io.*;


  4. public class SumIt
  5. {
  6.   public static void main(String[] args) throws IOException
  7.   {
  8.     // Step1: read data from command line parameters and add them
  9.     int sum = Integer.parseInt(args[0]) + Integer.parseInt(args[1]);
  10.     // Step2: show result
  11.     System.out.println(“Sum: ” + sum);
  12.   }
  13. }
复制代码

7
ReneeBK 发表于 2015-9-25 10:12:52
  1. Listing 1.4. SumIt2 with Exception Handling



  2. // SumIt2.java
  3. import java.io.*;


  4. public class SumIt2
  5. {
  6.   public static void main(String[] args) throws IOException
  7.   {
  8.     try
  9.     {
  10.       int sum = Integer.parseInt(args[0]) + Integer.parseInt(args[1]);
  11.       System.out.println(“Sum: ” + sum);
  12.     }
  13.     catch (NumberFormatException e)
  14.       System.out.println(“Enter 2 integers in command prompt”);
  15.     }
  16.   }
  17. }
复制代码

8
ReneeBK 发表于 2015-9-25 10:14:17

  1. // PrintName.java
  2. import java.io.*;
  3. import java.util.*;

  4. public class PrintName
  5. {
  6.   public static void main(String[] args)
  7.   {
  8.     // Step1: create a Scanner instance to keyboard
  9.     Scanner sc = new Scanner(System.in);
  10.     // Step2: get first name
  11.     System.out.print(“Enter your first name: ” );
  12.     String fname = sc.nextLine();
  13.     // Step3: get last name
  14.     System.out.print(“Enter your last name: ” );
  15.     String lname = sc.nextLine();
  16.     // Step4: show
  17.     System.out.print(“Your name is ” + lname + “ ” +fname);
  18.   }
  19. }
复制代码

9
ReneeBK 发表于 2015-9-25 10:17:51
  1. Listing 1.6. PrintSum Application

  2. // PrintSum.java
  3. import java.util.*;

  4. public class PrintSum
  5. {
  6.   public static void main(String[] args)
  7.   {
  8.     // Step1: create a Scanner instance to keyboard
  9.     Scanner sc = new Scanner(System.in);
  10.     // Step2: get first number
  11.     System.out.print(“Enter integer1: ” );
  12.     int a = sc.nextInt();
  13.     // Step3: get second number
  14.     System.out.print(“Enter integer2: ” );
  15.     int b = sc.nextInt();
  16.     // Step4: discard \n
  17.     sc.nextLine();
  18.     // Step5: get name
  19.     System.out.print(“Enter your name: ” );
  20.     String name = sc.nextLine();
  21.     // Step6: show
  22.     System.out.println(“Hello ” + name + “ Sum is ” + (a+b));
  23.   }
  24. }
复制代码

10
Jealy 在职认证  发表于 2015-9-25 11:38:03

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-31 00:01