コンテンツにスキップ

検索結果

(前の20件 | ) (20 | 50 | 100 | 250 | 500 件) を表示
  • るときに呼び出されるのがデストラクタです。 class Cat { public: Cat() { std::cout << "Cat is created" << std::endl; } ~Cat() { std::cout << "Cat is destroyed" << std::endl;…
    15キロバイト (1,609 語) - 2024年5月17日 (金) 21:41
  • CatクラスとDogクラスではそれをオーバーライドして独自の動作を定義しています。それぞれのインスタンスを生成してメソッドを呼び出すと、適切なサウンドが表示されます。 class Person { String name int age void sayHello()…
    92キロバイト (11,563 語) - 2024年2月5日 (月) 00:26
  • def check_name(name = nil) if name && name.length > 0 puts "名前は#{name}です" else puts "名前が未入力です" end end check_name() # => "名前が未入力です" check_name("") # =>…
    275キロバイト (36,204 語) - 2024年3月14日 (木) 06:00
  • World(str) 9(int) {'cat': 'tama', 'dog': 'pochi', 'year': 1776}(dict) cat(str) tama(str) dog(str) pochi(str) year(str) 1776(int) {'bird', 'cat', 'dog'}(set)…
    40キロバイト (5,132 語) - 2024年6月27日 (木) 05:23
  • コード例 main() { var cat = "Miku"; // 猫の名前 print("The name of the cat is ${cat} \n"); } 実行結果 The name of the cat is Miku 下記コードのように/*と*/で文を囲むと2行以上をコメントにできます。…
    45キロバイト (6,183 語) - 2024年1月24日 (水) 10:11
  • name) case type when :cat Cat.new(name) when :dog Dog.new(name) end end end class Cat def initialize(name) @name = name end def speak puts "#{@name}がニャーと鳴きました。"…
    36キロバイト (4,791 語) - 2024年3月8日 (金) 01:22
  • __construct($name) { parent::__construct($name); $this->sound = "Woof!"; } public function makeSound() { echo $this->name . " says " . $this->sound; } } class Cat
    74キロバイト (10,058 語) - 2023年11月28日 (火) 06:20
  • method naku() { print "ワン" } } class cat { method naku() { print "ニャー" } } BEGIN { pochi = dog.new() mike = cat.new() print "ポチが鳴くよ。" pochi.naku() print…
    13キロバイト (1,936 語) - 2022年7月7日 (木) 08:04
  • NO_INPUT_PROMPT = r'<s>\n以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。\n[SEP]\n指示:\n{instruction}\n[SEP]\n応答:\n' USER_NAME = "User" ASSISTANT_NAME = "Assistant"…
    12キロバイト (1,504 語) - 2023年9月22日 (金) 13:56
  • 最後に、新しいCatオブジェクトを作成して、メソッドの動作を確認します。 myCat = Cat:new{} myCat:makeSound() -- Prints "Meow" myCat:scratch() -- Prints "I am scratching stuff!" この例では、Cat
    59キロバイト (7,067 語) - 2024年1月24日 (水) 10:18
  • ] [--color=when] [-D format] [file ...] % cat -@ cat: illegal option -- @ usage: cat [-belnstuv] [file ...] 詳しくは man を引くべきですが、思い出すためには役立つことがあります。…
    74キロバイト (10,824 語) - 2024年4月21日 (日) 23:51
  • dog") case is Cat: print("It's a cat") default: print("It's something else") } } この例では、animals配列の要素がDog型かCat型かをテストしています。is演算子を使用することで、Dog型かCat型かどうかを簡単にテストすることができます。…
    39キロバイト (5,052 語) - 2024年1月30日 (火) 12:29
  • をそのまま実行してみます。 hello.crを用意します。 hello.cr puts 'Hello, World!' コマンドラインでの操作 % cat hello.cr puts 'Hello, World!' % crystal hello.cr In hello.cr:1:6 1 | puts…
    92キロバイト (11,338 語) - 2024年3月11日 (月) 01:22
  • の名前で保存します(カレントディレクトリーに hello.kt がある場合)。 タブと空白には区別され、先頭の空白8つ分はタブです。 コマンドラインでの操作は tcshの場合 % cat hello.kt fun main() { println("Hello world!") } % make hello.jar kotlinc…
    5キロバイト (723 語) - 2022年11月20日 (日) 06:47
  • /usr/bin/env perl use v5.30.0; say "Hello, World"; say "Hello, Perl"; コマンドラインでの実行 % cat > hello.pl #!/usr/bin/env perl use v5.30.0; say "Hello, World"; say "Hello…
    22キロバイト (2,874 語) - 2024年6月12日 (水) 21:54
  • output stdout sqlite> .quit $ cat periodic.txt PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE elements( number ,name ,symbol ); INSERT INTO elements…
    35キロバイト (7,208 語) - 2024年3月3日 (日) 10:49
  • error_code(): 値 0 と system_category で初期化 error_code(int val, const error_category& cat): 値とカテゴリを設定 error_code(ErrorCodeEnum e): ユーザー定義の ErrorCodeEnum 型の場合 メンバー関数:…
    5キロバイト (561 語) - 2024年5月31日 (金) 23:43
  • name}.`); } } const cat: Animal = new Animal("Tama"); // Animalクラスのインスタンス cat.sayHello(); // インターフェイスとジェネリックス interface Person<T> { name: string; age: T;…
    110キロバイト (13,992 語) - 2024年5月5日 (日) 02:47
  • Shape(val name: String) { abstract fun draw() } class Circle(name: String) : Shape(name) { override fun draw() { println("Drawing a circle named $name") } }…
    180キロバイト (28,649 語) - 2024年6月27日 (木) 04:46
  • __construct($name) { parent::__construct($name); $this->sound = "Woof!"; } public function makeSound() { echo $this->name . " says " . $this->sound; } } class Cat
    2キロバイト (40,455 語) - 2022年12月7日 (水) 00:06
(前の20件 | ) (20 | 50 | 100 | 250 | 500 件) を表示