public class Test { public static void leftshift(int i, int j) { i<<=j; } public static void main(String args) { int i = 4, j = 2; leftshift(i, j); System.out.printIn(i); } } What is the result? ()
相似题目
-
package test1; public class Test1 { static int x = 42; } package test2; public class Test2 extends test1.Test1 { public static void main(String[] args) { System.out.println(“x = “ + x); } } What is the result?()
-
1.public class Test{ 2.int x=12; 3.public void method(intx){ 4.x+=x; 5.System.out.println(x); 6.} 7.} Given: 34.Test t=new Test(); 35.t.method(5); What is the output from line 5 of the Test class?()
-
public class Test {public int call(){static int i=0;i++;System.out.println(i);}public static void main(String args[]){Test test = new Test();test.call();}}
-
给定JAVA代码,如下:Class Parent{public void count() {System.out.println(10%3) ;}}public class Test extends Parent{public void count() {System.out.println(10/3) ;}public static void main(Stringargs[]) {Parent p = new Test() ;p.count() ;}}运行编译后,输出结果是()。
-
给定java程序Test.java如下,编译运行,结果是( ) 。package com;class Test {protected void talk () {System.out.print(talk) ; }}给定Test 的子类Test2,代码如下:packagecom.util;import com.*;public class Test2 extends Test {public static void main (String[]args) {new Test2() .talk() ;}
-
给出如下类定义:public class test {test(int k) { }}如果要创建一个该类的对象,正确的语句是:
-
有以下代码:package com;public class Test {public static void main(String[] args) {Test test = new Test();//here}}在here处加上以下什么语句,可以获得Class对象?(多选)
-
public class A{ public static void main(String args[]){ B b = new B(); b.test(); } public void test(){ System.out.print(\A\); } } class B extends A{ void test(){ super.test(); System.out.println(\B\); } }
-
考虑如下类:public class Test {int j,k;public Test(int j ) {this(j,0);}public Test(int j, int k) {this.j=j;this.k=k;}}以下哪些可正确创建Test对象?
-
分析如下所示的Java代码,则选项中的说法正确的是( )。 class Parent{ public String name; public Parent(String pName){ this.name = pName; } } public class Test extends Parent { //1 public Test(String Name){ //2 name=\hello
-
下列程序输出结果为()。 public class test { public static void main (String args[]) {
-
有如下程序:includeusing namespace std;Class Test{public:Test(){}Test(const Test&t){co
-
下列程序的输出结果为()。public class Test {public static void main (String[] args) { int
-
下面程序段的输出结果为package test;public class Class A{ int x=20; static int y=6; public
-
下列语句输出结果为()。 public class test{ public static void main(String args[]) String s1
-
有如下类定义: class Test { public: Test(){a=0;c=0;} //① int f(in
-
有如下程序:include<iostream>using namespace std;class Test{public:Test(){n+=2;}~Test(){n-
-
关于下面的程序Test.java说法正确的是()。public class Test {String x="1";int y;
-
代码三: public class Test03 { public static void main(); } }
-
以下代码可以编译通过 public class Test01 { public static void main(); } }
-
给定如下代码,下面可以作为该类的构造函数的是()public class Test {}
-
代码四: public class Test04 { public static void main(); n--; } } }
-
Given: public class Test { public static void main (); } } What is the result?
-
已知有如下代码: import java.util.*; public class Test{ public static void main(); } }
-
下列代码中,将引起一个编译错误的行是 1) public class Test 2) int m,n; 3) public Test() 4) public Test(int
推荐题目
- 交换机之间的互联采用交叉线序;交换机到路由器之间采用直连线序;服务器到交换机采用交叉线序。
- 日发行量在三大报纸中最高的报纸是()。
- 为了反对和遏制台独分裂势力分裂国家,促进祖国和平统一,维护台湾海峡地区和平稳定,维护国家主权和领土完整,维护中华民族的根本利益,根据宪法制定了什么法?并于何时通过施行?
- 装卸搬运技术装备中的起重机械主要由()组成。
- 成长期企业人力资源战略规划的重点是( )
- 个人理想的实现,必须以( )的实现为前提和基础。
- 目前中小学信息技术与课程整合中存在的主要问题包括()。
- 内装易碎物品或流质物品的国际及港澳特快专递邮件,每件限重20千克。此题为判断题(对,错)。
- 焊丝牌号ER55-B2-Mn中55的含义是()
- 液压系统中的油泵属于____元件。____《游乐设施安全技术》