본문 바로가기

백엔드기술/개발언어55

ArrayDemo package java_samples_hwang; /** * * @author hwang */ public class ArrayDemo { public static void main(String args[]) { int[] anArray; // declares an array of integers anArray = new int[5]; // allocates memory for 10 integers anArray[0] = 100; // initialize first element anArray[1] = 200; // initialize second element anArray[2] = 300; // etc. anArray[3] = 400; anArray[4] = 500; System.out.println.. 2009. 12. 9.
Modularization Modularization Example (Study) Dear all, 안녕하세요 공유하고 함께 의논해볼만한 것을 준비했습니다. 다음의 문제를 해결하기 위한 3개의 코드가 첨부되어 있습니다. ==[문제]=============================================== ------------------------------------------------------------------------------------------------ 아래와 같은 Input 스트링이 있습니다. 꺽쇠 기호 사이의 문자열 중 스페이스 공간을 언더바( _ )로 바꾸고 양쪽 여백을 삭제하여 출력하세요. Input : " " Output : " " --------------------------------.. 2009. 12. 9.
VB.NET, C# and VC++ Comparison 1. Purpose The purpose of this document is to make initial recommendations based on a comparative analysis of VC++, VB.NET and C# for development of Blu Ray Disc authoring application. The document first talks about features of VC++, VB.NET and C#. Then it compares the pros and cons of each development environment with respect to various evaluation criteria. Recommendation follows in the later s.. 2009. 12. 9.
값이 오버플로우되는지 확인하기 - checked C#에서는 다양한 키워드들을 제공하는데 이번에는 아래의 약간의 특별한 키워드에 대해 포스팅 할 예정이다. - checked / unchecked 이 키워드는 오버플로우가 일어나는지 체크하여 오버플로우시 예외를 발생시킨다. 사용법은 아래와 같다. checked( 체크할문장 ) 또는 checked { 체크할 코드 블럭 } 예제 static void Main(string[] args) { byte b1 = 200; byte b2 = 100; try { byte b3 = checked((byte)(b1 + b2)); //byte는 0부터 255까지의 값만 가질 수 있다! Console.WriteLine("b3 = {0}", b3); } catch (OverflowException e) { Console.Writ.. 2009. 3. 24.
C# 정규식 예제 static void Main(string[] args) { string str = "abcwDW2"; Regex regex = new System.Text.RegularExpressions.Regex(@"^[0-9a-zA-Z]{1,100}$"); Boolean ismatch = regex.IsMatch(str); if (!ismatch) { Console.WriteLine("숫자와 영문 소문자,대문자만 입력가능합니다.(글자제한100)"); } } 영문 소문자, 대문자와 숫자만 가능하도록 하는 유효성 체크에 사용될 만한 예제입니다. 글자수 제한도 저렇게 하는군요^^ 2009. 3. 17.
.Net Framework 버젼별 포함된 기술들 .NET Framework 2.0에 포함된 기술 다음과 같은 기술이 .NET Framework 2.0에서 제공됩니다. CLR(공용 언어 런타임) 제네릭 형식 및 메서드에 대한 지원 C#, Visual Basic, C++ 및 J#용 컴파일러 기본 클래스 라이브러리 ADO.NET ASP.NET Windows Forms 웹 서비스 .NET Framework 3.0에 포함된 기술 .NET Framework 3.0을 컴퓨터에 설치하려면 .NET Framework 2.0이 필요합니다. .NET Framework 2.0이 없는 컴퓨터에 .NET Framework 3.0을 설치할 경우 .NET Framework 2.0이 자동으로 설치됩니다. 다음과 같은 기술이 .NET Framework 3.0에서 제공됩니다. WPF(.. 2009. 3. 11.