- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
湖南科技学院2015年Java试卷
Java Examination 2014 – 15
Total Marks: 100
Q1. Multiple Choice Questions (10 Marks)
Keyboard is ____a___ device.
Input
Output
Processing
Storing
Java compiler translates a java source file into a __b____ file
HTML
Bytecode
Javascript
JSP
____c____ is the brain of the computer.
RAM
OS
CPU
BUS
Full Form of JVM b
Java Variety Machine
Java Virtual Machine
Java Valuable Machine
Java Volume Machine
“A Java program must have a main method”. Is this statement true? a
Yes
No
May Be
I don’t know
Which keyword from following is used to define a constant? a
Final
Constant
Const
Max
Range of INT data type is b
- 2147483648 to 2147423647
- 32768 to 32767
- 128 to 127
None of the above
Which of the following is pre decrement? b
++var
- -var
var++
var- -
What is output of the 96 % 4 - 4? b
4
-4
-0
0
What is the value of k of the boolean k = “TRUE”? c
TRUE
FALSE
ERROR
NO OUTPUT
Q2. What will be output of the following code? (5 Marks)
public class Output_01{
public static void main(String[] args){
float f = 12.5F;
int i = (int) f; char x = ‘a’;
System.out.println(f);
System.out.println(i);
System.out.println(++x);
System.out.println(“1” + 1);
System.out.println(1 + “Welcome”+ 1+1);
}
}
The result:
12.5
12
b
11
1Welcome11
Q3. Write a Java Program to find an input year is leap year or not. (5 Marks)
(Hint : leap year is divisible by 4)
Example:
Input : Enter a year : 2012
Output : 2012 is a leap year.
Input : Enter a year : 2017
Output : 2017 is not a leap year.
代码:
import java.util.*;
public class FindLeapYear {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(Enter a year :);
int year = input.nextInt();
if((year % 4 == 0 year % 100 !=0 )|| year % 400 == 0)
System.out.println(year+ is a leap year);
else
System.out.println(year+
您可能关注的文档
最近下载
- 玉米全程机械化技术课件.pptx VIP
- 大学生职业规划大赛《舞蹈学专业》生涯发展展示PPT.pptx
- 2024中国网球市场和网球人群洞察报告.pdf VIP
- PMC部经理任命书.docx VIP
- (高清版)B-T 4798.3-2023 环境条件分类 环境参数组分类及其严酷程度分级 第3部分:有气候防护场所固定使用.pdf VIP
- 矿物绝缘电缆.pptx VIP
- 2025年杭州青少年活动中心公开招聘工作人员2人笔试备考试题及答案解析.docx VIP
- GB 19577-2024 热泵和冷水机组能效限定值及能效等级.docx VIP
- CCAA认证通用基础合格评定[98].pdf VIP
- 《网店运营与管理》电子商务专业全套教学课件.pptx
文档评论(0)