Advertisement
ruthiek

Untitled

Feb 28th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. 1,1,Which of the following statements has no errors?,System.out.print("hello"),system.out.print(hello);,system.out.print("hello");,System.out.print("hello");,4,The statement with no errors is System.out.print("hello");
  2. 1,2,Which of the following statements has no errors?,char c = "d";,char c = 'd',char c = 'd';,char c = d;,3,The statement with no errors is char c = 'd';
  3. 1,3,Which of the folllowing statements has no errors?,public static void main,public static void main(String [] args),public static void Main(String [] args),public static void main(String [] args);,2,The statement with no errors is public static void main(String [] args)
  4. 1,4,Which of the following statements has no errors?,String myArray = new String[];,String[] myArray = new int[];,String[] myArray = new String[];,int[] myArray = new String[];,3, The statement with no errors is String[] myArray = new String[];
  5. 1,5,Which of the following statements has no errors?,String x = "result";,String x = 'result';,String x = "result",String x = result;,1,The statement with no errors is String x = "result";
  6. 1,6,Which of the following statements has no errors?,int[] array = {1,2,3,4},int[] array = [1,2,3,4];,int[] array = {1,2,3,4};,int[] array = 1,2,3,4;,3,The statement with no errors is int[] array = {1,2,3,4};
  7. 1,7,Which of the following statements has no errors?,Scanner in = new Scanner(System.in),Scanner in = new Scanner(System.out);,Scanner in = new Scanner(System.in);,Scanner in = new Scanner;,3,The statement with no errors is Scanner in = new Scanner(System.in);
  8. 2,1,What is the minimum and maximum value for a byte,-128 and 127,-32768 and 32767,-130 and 129,65 and 123,1,The minimum value for a byte is -128 and the maximum is 127.
  9. 2,2,What is the unicode value for €,\u0024,\u20AC,\u00A2,\u00A3,2,The unicode value for € is \u20AC
  10. 2,3,How do you convert a String to an int,String.parseInt,Int.parseInt,Integer.parseInt,Integer.parseString,3,To convert a String to an int you use Integer.parseInt
  11. 2,4,If you add an int an a double, what is the resulting type?,int,byte,double,float,When you add an int and a double the new number takes on the type double.
  12. 2,5,What is the minimum and maximum value for an int,-128 and 127,-32768 and 32767,-130 and 129,-2,147,483,648 and 2,147,483,647,2,The minimum value for an int is -2,147,483,648 and the maximum is 2,147,483,647.
  13. 2,6,What is the unicode value for $,\u0024,\u20AC,\u00A2,\u00A3,1,The unicode value for € is \u0024
  14. 2,7,How do you read an int from the console window,in.nextInt(),in.nextLine(),in.next(),in.nextInteger(),1,In order to read an int from the console window you use in.nextInt()
  15. 2,8,What is the integer value of f,100,98,105,102,4,The integer value of f is 102
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement