Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Sun Guoqiao's mock exam about identifiers?

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the question:
Choose valid identifiers?
(Select three correct answers)
-----------------------------------------------------------------------
-----------------------------------------------------------------------
A: @100
B: $100
C: String
D: aString
E: switch
the correct answer is B,C,D.
but why the C is correct?I do a test,my code as follows:
public class Test028 extends Object
{
final int y; //1

public Test028() {
y = 0; //2
}

public Test028(int val) {
y = 1; //3
}
public void test()
{
String String=new String("ss");
System.out.println(String);
}
public static void mian(String args[])
{
Test028 test028=new Test028();
test028.test();
}
}
and compile correctly,but "java.lang.NoSuchMethodError: main
Exception in thread "main" " when running,and ,is this sentence " the word "String" can be an identifile" is right?
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just take look to main its main not mian thanks
read code well before you post
 
dragon ji
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so sorry,I am careless,thank you.
reply
    Bookmark Topic Watch Topic
  • New Topic