CµÄenum struct ÒÔ¼° JavaµÄenum
ÔÚcÖÐenumµÄʹÓúÍstructºÜÏñ
enum name{
a,b,c
};
struct name{
int a;
int b;
char c;
};
or
typedef struct{
int a;
int b;
char c;
}Name;
ʹÓõÄʱºò¶¼ÒªÏÈÉùÃ÷±äÁ¿
enum name n1,n2,n3;
n1=a;
n2=b;
n3=enum name(3-1);
struct name sn1,sn2;
sn1=(struct name *)malloc(parameter*sizeof(struct name))//ʹÓÃmallocµÄʱºòҪǿÖÆת»»£»
ÔÚjavaÖÐenumµÄʹÓãº
ºÍÀàµÄ¶¨Òå·Ç³£µÄÏàÏñ£¬»òÕßÓгÆΪÊǾ²Ì¬Àࣺ
public enum MyColor{red,yellow,black};
ÔÚʹÓõÄʱºòÒªÏÈnew¶ÔÏó£»
MyColor mc=MyColor.red;//new¶ÔÏó²¢ÇÒ³õʼ»¯£»È»ºó¾Í¿ÉÒÔʹÓÃÕâ¸ö¶ÔÏó£»
public class test{
public enum MyColor{
red;
black;
}
public static void main(String [] args){
MyColor mc= MyColor.red;
switch (mc){
case red:System.out.println("red");break;
case black:System.out.println("black");break;
default:System.out.println("Error");
}
}
}
Ïà¹ØÎĵµ£º
1.Áоٳö 10¸öJAVAÓïÑÔµÄÓÅÊÆ
a:Ãâ·Ñ£¬¿ªÔ´£¬¿çƽ̨(ƽ̨¶ÀÁ¢ÐÔ)£¬¼òµ¥Ò×Ó㬹¦ÄÜÍêÉÆ£¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔ£¬¶àỊ̈߳¬½á¹¹ÖÐÁ¢£¬ÆóÒµÓ¦ÓõijÉÊìƽ̨, ÎÞÏßÓ¦ÓÃ
2.ÁоٳöJAVAÖÐ10¸öÃæÏò¶ÔÏó±à³ÌµÄÊõÓï
a:°ü£¬À࣬½Ó¿Ú£¬¶ÔÏó£¬ÊôÐÔ£¬·½·¨£¬¹¹ÔìÆ÷£¬¼Ì³Ð£¬·â×°£¬¶à̬£¬³éÏ󣬷¶ÐÍ
3.ÁоٳöJAVAÖÐ6¸ö±È½Ï³£ÓÃµÄ ......
×¢ÒâÊÂÏîÂýÂý»ýÀÛ
final À಻¿É±»¼Ì³Ð£¬Ò²²»ÄÜÓÐ×ÓÀà¡£
final class Book{}
//class ComBook extends Book{} Õ⽫±àÒëʧ°Ü£¬ÒòΪBookÀ಻¿É±»¼Ì³Ð¡£
final·½·¨²»¿É±»¸Äд
class Book{
final void show£¨£©{System.out.println("Book ......
ÕâÁ½Ìì,ÒòΪÏîÄ¿ÐèÒª,Éæ¼°µ½Îļþ¼ÐµÄÉÏ´«,ÏëÁ˺ܾÃ,ÔÚÍøÉÏÒ²ÕÒÁËһЩ×ÊÁÏ,¶¼Ã»ÓÐʲôºÜºÃµÄ°ì·¨,¶¼ÊÇÓòå¼þÖ®ÀàµÄ½â¾ö,ºóÃæ¾ÍÏëµ½ÁËÉÏ´«Ñ¹Ëõ
Îļþ,˵µ½Ñ¹ËõÎļþ,×ÔÈ»¾Í»áÓöµ½,ÎļþµÄ½âѹËõÎÊÌâ,´ó¼Ò¶¼ÖªµÀ,±È½Ï³£¼ûµÄѹËõÎļþÓÐrar,zip,È»¶ørar,zipµÄÇø±ðÓÖÔÚÄÄ?˵һ
µã,zip ѹËõËã·¨ÊÇÃâ·Ñ¿ª·ÅµÄ£¬ÈκÎÈË¿ÉÒÔÃâ·ÑʹÓᣵ ......
C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©
#include <stddef.h>
char * ___strtok = NULL;
char * strcpy(char * dest,const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}
char * strncpy(char * dest,const char *src,size_t count)
{
char *tmp = d ......
ÎÊÌâµÄÌá³ö
¡¡¡¡¶à¹úÓïÑԵĴæÔÚ¡¢²»Í¬ÓïÑÔ²Ù×÷ϵͳµÄ´æÔÚ£¬Ê¹µÃÕë¶Ô¶àÓïÑÔµÄÉè¼ÆÆÄ·ÑÖÜÕ£¬ÔÚ±àÂëÉÏËù¸¶³öµÄ¹¤×÷Á¿Ò²Êǿɹ۵ġ£Ëùν±àÂëµÄÎÊÌ⣬¹é½áÆðÀ´£¬¾ÍÊǶþ½øÖƵıàÂëÒÔºÎÖÖ±àÂë¸ñʽ½øÐнâÎöµÄÎÊÌâ¡£ÌرðÊÇÔÚÓ²ÅÌÎļþºÍÄÚ´æÊý¾ÝµÄÏ໥ת»¯¡¢¼´¶Áд¹ý³ÌÖУ¬Èç¹û²ÉÓÃÁË´íÎóµÄ±àÂë¸ñʽ£¬¾Í»áÔì³ÉÂÒÂë¡£JAVA ÓïÑÔÔÚ×Ö·û´ ......